﻿using System;
using System.Data;
using System.Data.SqlClient;
using ShoveEL.Database;

namespace DAL
{
    /*
    Program Name: ShoveDAL
    Program Version: 1.0
    Writer By: 7ien.shovesoft.shove (zhou changjun)
    Release Time: 2007.2.4

    System Request: ShoveEL.dll
    All Rights saved.
    */


    // Please Add a Key in Web.config File's appSetting section, Exemple:
    // <add key="ConnectionString" value="server=(local);User id=shove;Pwd=;Database=ShoveLottery" />


    public class Tables
    {
        public class T_SalesLimit
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_SalesLimit]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, int GoodTypeID, bool isInsertGoodTypeID, double SalesMoney, bool isInsertSalesMoney, int SalesDay, bool isInsertSalesDay, double SalesMoneySum, bool isInsertSalesMoneySum, DateTime SalesDayEnd, bool isInsertSalesDayEnd)
            {
                string CommandText = "insert into [T_SalesLimit] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertGoodTypeID)
                    InsertFieldsList += "[GoodTypeID], ";
                if (isInsertSalesMoney)
                    InsertFieldsList += "[SalesMoney], ";
                if (isInsertSalesDay)
                    InsertFieldsList += "[SalesDay], ";
                if (isInsertSalesMoneySum)
                    InsertFieldsList += "[SalesMoneySum], ";
                if (isInsertSalesDayEnd)
                    InsertFieldsList += "[SalesDayEnd], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertGoodTypeID)
                    InsertValuesList += "@GoodTypeID, ";
                if (isInsertSalesMoney)
                    InsertValuesList += "@SalesMoney, ";
                if (isInsertSalesDay)
                    InsertValuesList += "@SalesDay, ";
                if (isInsertSalesMoneySum)
                    InsertValuesList += "@SalesMoneySum, ";
                if (isInsertSalesDayEnd)
                    InsertValuesList += "@SalesDayEnd, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertGoodTypeID ? null : new MSSQL.Parameter("GoodTypeID", SqlDbType.Int, 0, ParameterDirection.Input, GoodTypeID),
                    !isInsertSalesMoney ? null : new MSSQL.Parameter("SalesMoney", SqlDbType.Money, 0, ParameterDirection.Input, SalesMoney),
                    !isInsertSalesDay ? null : new MSSQL.Parameter("SalesDay", SqlDbType.Int, 0, ParameterDirection.Input, SalesDay),
                    !isInsertSalesMoneySum ? null : new MSSQL.Parameter("SalesMoneySum", SqlDbType.Money, 0, ParameterDirection.Input, SalesMoneySum),
                    !isInsertSalesDayEnd ? null : new MSSQL.Parameter("SalesDayEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, SalesDayEnd)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, int GoodTypeID, bool isUpdateGoodTypeID, double SalesMoney, bool isUpdateSalesMoney, int SalesDay, bool isUpdateSalesDay, double SalesMoneySum, bool isUpdateSalesMoneySum, DateTime SalesDayEnd, bool isUpdateSalesDayEnd)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_SalesLimit] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateGoodTypeID)
                    UpdateFieldsList += "[GoodTypeID] = @GoodTypeID, ";
                if (isUpdateSalesMoney)
                    UpdateFieldsList += "[SalesMoney] = @SalesMoney, ";
                if (isUpdateSalesDay)
                    UpdateFieldsList += "[SalesDay] = @SalesDay, ";
                if (isUpdateSalesMoneySum)
                    UpdateFieldsList += "[SalesMoneySum] = @SalesMoneySum, ";
                if (isUpdateSalesDayEnd)
                    UpdateFieldsList += "[SalesDayEnd] = @SalesDayEnd, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateGoodTypeID ? null : new MSSQL.Parameter("GoodTypeID", SqlDbType.Int, 0, ParameterDirection.Input, GoodTypeID),
                    !isUpdateSalesMoney ? null : new MSSQL.Parameter("SalesMoney", SqlDbType.Money, 0, ParameterDirection.Input, SalesMoney),
                    !isUpdateSalesDay ? null : new MSSQL.Parameter("SalesDay", SqlDbType.Int, 0, ParameterDirection.Input, SalesDay),
                    !isUpdateSalesMoneySum ? null : new MSSQL.Parameter("SalesMoneySum", SqlDbType.Money, 0, ParameterDirection.Input, SalesMoneySum),
                    !isUpdateSalesDayEnd ? null : new MSSQL.Parameter("SalesDayEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, SalesDayEnd)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_SalesLimit]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_SalesLimit]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_UserPayNumberList
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_UserPayNumberList]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long PayNumber, bool isInsertPayNumber, double Money, bool isInsertMoney)
            {
                string CommandText = "insert into [T_UserPayNumberList] (";
                string InsertFieldsList = "";

                if (isInsertPayNumber)
                    InsertFieldsList += "[PayNumber], ";
                if (isInsertMoney)
                    InsertFieldsList += "[Money], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertPayNumber)
                    InsertValuesList += "@PayNumber, ";
                if (isInsertMoney)
                    InsertValuesList += "@Money, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertPayNumber ? null : new MSSQL.Parameter("PayNumber", SqlDbType.BigInt, 0, ParameterDirection.Input, PayNumber),
                    !isInsertMoney ? null : new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money)
                    );
            }

            public static int Update(string Condition, long PayNumber, bool isUpdatePayNumber, double Money, bool isUpdateMoney)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_UserPayNumberList] set ";
                string UpdateFieldsList = "";

                if (isUpdatePayNumber)
                    UpdateFieldsList += "[PayNumber] = @PayNumber, ";
                if (isUpdateMoney)
                    UpdateFieldsList += "[Money] = @Money, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdatePayNumber ? null : new MSSQL.Parameter("PayNumber", SqlDbType.BigInt, 0, ParameterDirection.Input, PayNumber),
                    !isUpdateMoney ? null : new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_UserPayNumberList]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_UserPayNumberList]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_UpFiles
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_UpFiles]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(string FileName, bool isInsertFileName, string FileURL, bool isInsertFileURL, DateTime DateTime, bool isInsertDateTime, string Remark, bool isInsertRemark)
            {
                string CommandText = "insert into [T_UpFiles] (";
                string InsertFieldsList = "";

                if (isInsertFileName)
                    InsertFieldsList += "[FileName], ";
                if (isInsertFileURL)
                    InsertFieldsList += "[FileURL], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertRemark)
                    InsertFieldsList += "[Remark], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertFileName)
                    InsertValuesList += "@FileName, ";
                if (isInsertFileURL)
                    InsertValuesList += "@FileURL, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertRemark)
                    InsertValuesList += "@Remark, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertFileName ? null : new MSSQL.Parameter("FileName", SqlDbType.VarChar, 0, ParameterDirection.Input, FileName),
                    !isInsertFileURL ? null : new MSSQL.Parameter("FileURL", SqlDbType.VarChar, 0, ParameterDirection.Input, FileURL),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertRemark ? null : new MSSQL.Parameter("Remark", SqlDbType.VarChar, 0, ParameterDirection.Input, Remark)
                    );
            }

            public static int Update(string Condition, string FileName, bool isUpdateFileName, string FileURL, bool isUpdateFileURL, DateTime DateTime, bool isUpdateDateTime, string Remark, bool isUpdateRemark)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_UpFiles] set ";
                string UpdateFieldsList = "";

                if (isUpdateFileName)
                    UpdateFieldsList += "[FileName] = @FileName, ";
                if (isUpdateFileURL)
                    UpdateFieldsList += "[FileURL] = @FileURL, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateRemark)
                    UpdateFieldsList += "[Remark] = @Remark, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateFileName ? null : new MSSQL.Parameter("FileName", SqlDbType.VarChar, 0, ParameterDirection.Input, FileName),
                    !isUpdateFileURL ? null : new MSSQL.Parameter("FileURL", SqlDbType.VarChar, 0, ParameterDirection.Input, FileURL),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateRemark ? null : new MSSQL.Parameter("Remark", SqlDbType.VarChar, 0, ParameterDirection.Input, Remark)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_UpFiles]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_UpFiles]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_TryForSurrogate
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_TryForSurrogate]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(DateTime DateTime, bool isInsertDateTime, long UserID, bool isInsertUserID, int DealResult, bool isInsertDealResult, DateTime DealDateTime, bool isInsertDealDateTime)
            {
                string CommandText = "insert into [T_TryForSurrogate] (";
                string InsertFieldsList = "";

                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDealResult)
                    InsertFieldsList += "[DealResult], ";
                if (isInsertDealDateTime)
                    InsertFieldsList += "[DealDateTime], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDealResult)
                    InsertValuesList += "@DealResult, ";
                if (isInsertDealDateTime)
                    InsertValuesList += "@DealDateTime, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDealResult ? null : new MSSQL.Parameter("DealResult", SqlDbType.Int, 0, ParameterDirection.Input, DealResult),
                    !isInsertDealDateTime ? null : new MSSQL.Parameter("DealDateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DealDateTime)
                    );
            }

            public static int Update(string Condition, DateTime DateTime, bool isUpdateDateTime, long UserID, bool isUpdateUserID, int DealResult, bool isUpdateDealResult, DateTime DealDateTime, bool isUpdateDealDateTime)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_TryForSurrogate] set ";
                string UpdateFieldsList = "";

                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDealResult)
                    UpdateFieldsList += "[DealResult] = @DealResult, ";
                if (isUpdateDealDateTime)
                    UpdateFieldsList += "[DealDateTime] = @DealDateTime, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDealResult ? null : new MSSQL.Parameter("DealResult", SqlDbType.Int, 0, ParameterDirection.Input, DealResult),
                    !isUpdateDealDateTime ? null : new MSSQL.Parameter("DealDateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DealDateTime)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_TryForSurrogate]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_TryForSurrogate]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_OperationLog
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_OperationLog]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, DateTime DateTime, bool isInsertDateTime, string Memo, bool isInsertMemo, string UserIP, bool isInsertUserIP)
            {
                string CommandText = "insert into [T_OperationLog] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertMemo)
                    InsertFieldsList += "[Memo], ";
                if (isInsertUserIP)
                    InsertFieldsList += "[UserIP], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertMemo)
                    InsertValuesList += "@Memo, ";
                if (isInsertUserIP)
                    InsertValuesList += "@UserIP, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertMemo ? null : new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    !isInsertUserIP ? null : new MSSQL.Parameter("UserIP", SqlDbType.VarChar, 0, ParameterDirection.Input, UserIP)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, DateTime DateTime, bool isUpdateDateTime, string Memo, bool isUpdateMemo, string UserIP, bool isUpdateUserIP)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_OperationLog] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateMemo)
                    UpdateFieldsList += "[Memo] = @Memo, ";
                if (isUpdateUserIP)
                    UpdateFieldsList += "[UserIP] = @UserIP, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateMemo ? null : new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    !isUpdateUserIP ? null : new MSSQL.Parameter("UserIP", SqlDbType.VarChar, 0, ParameterDirection.Input, UserIP)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_OperationLog]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_OperationLog]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_Shipment
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_Shipment]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long GoodSalesID, bool isInsertGoodSalesID, string UserName, bool isInsertUserName, string Address, bool isInsertAddress, string Tel, bool isInsertTel, string OrderNo, bool isInsertOrderNo, DateTime DateTime, bool isInsertDateTime, bool Status, bool isInsertStatus, string UserRemark, bool isInsertUserRemark, string ShopRemark, bool isInsertShopRemark, DateTime ShopDateTime, bool isInsertShopDateTime)
            {
                string CommandText = "insert into [T_Shipment] (";
                string InsertFieldsList = "";

                if (isInsertGoodSalesID)
                    InsertFieldsList += "[GoodSalesID], ";
                if (isInsertUserName)
                    InsertFieldsList += "[UserName], ";
                if (isInsertAddress)
                    InsertFieldsList += "[Address], ";
                if (isInsertTel)
                    InsertFieldsList += "[Tel], ";
                if (isInsertOrderNo)
                    InsertFieldsList += "[OrderNo], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertStatus)
                    InsertFieldsList += "[Status], ";
                if (isInsertUserRemark)
                    InsertFieldsList += "[UserRemark], ";
                if (isInsertShopRemark)
                    InsertFieldsList += "[ShopRemark], ";
                if (isInsertShopDateTime)
                    InsertFieldsList += "[ShopDateTime], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertGoodSalesID)
                    InsertValuesList += "@GoodSalesID, ";
                if (isInsertUserName)
                    InsertValuesList += "@UserName, ";
                if (isInsertAddress)
                    InsertValuesList += "@Address, ";
                if (isInsertTel)
                    InsertValuesList += "@Tel, ";
                if (isInsertOrderNo)
                    InsertValuesList += "@OrderNo, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertStatus)
                    InsertValuesList += "@Status, ";
                if (isInsertUserRemark)
                    InsertValuesList += "@UserRemark, ";
                if (isInsertShopRemark)
                    InsertValuesList += "@ShopRemark, ";
                if (isInsertShopDateTime)
                    InsertValuesList += "@ShopDateTime, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertGoodSalesID ? null : new MSSQL.Parameter("GoodSalesID", SqlDbType.BigInt, 0, ParameterDirection.Input, GoodSalesID),
                    !isInsertUserName ? null : new MSSQL.Parameter("UserName", SqlDbType.VarChar, 0, ParameterDirection.Input, UserName),
                    !isInsertAddress ? null : new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address),
                    !isInsertTel ? null : new MSSQL.Parameter("Tel", SqlDbType.VarChar, 0, ParameterDirection.Input, Tel),
                    !isInsertOrderNo ? null : new MSSQL.Parameter("OrderNo", SqlDbType.VarChar, 0, ParameterDirection.Input, OrderNo),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertStatus ? null : new MSSQL.Parameter("Status", SqlDbType.Bit, 0, ParameterDirection.Input, Status),
                    !isInsertUserRemark ? null : new MSSQL.Parameter("UserRemark", SqlDbType.VarChar, 0, ParameterDirection.Input, UserRemark),
                    !isInsertShopRemark ? null : new MSSQL.Parameter("ShopRemark", SqlDbType.VarChar, 0, ParameterDirection.Input, ShopRemark),
                    !isInsertShopDateTime ? null : new MSSQL.Parameter("ShopDateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, ShopDateTime)
                    );
            }

            public static int Update(string Condition, long GoodSalesID, bool isUpdateGoodSalesID, string UserName, bool isUpdateUserName, string Address, bool isUpdateAddress, string Tel, bool isUpdateTel, string OrderNo, bool isUpdateOrderNo, DateTime DateTime, bool isUpdateDateTime, bool Status, bool isUpdateStatus, string UserRemark, bool isUpdateUserRemark, string ShopRemark, bool isUpdateShopRemark, DateTime ShopDateTime, bool isUpdateShopDateTime)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_Shipment] set ";
                string UpdateFieldsList = "";

                if (isUpdateGoodSalesID)
                    UpdateFieldsList += "[GoodSalesID] = @GoodSalesID, ";
                if (isUpdateUserName)
                    UpdateFieldsList += "[UserName] = @UserName, ";
                if (isUpdateAddress)
                    UpdateFieldsList += "[Address] = @Address, ";
                if (isUpdateTel)
                    UpdateFieldsList += "[Tel] = @Tel, ";
                if (isUpdateOrderNo)
                    UpdateFieldsList += "[OrderNo] = @OrderNo, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateStatus)
                    UpdateFieldsList += "[Status] = @Status, ";
                if (isUpdateUserRemark)
                    UpdateFieldsList += "[UserRemark] = @UserRemark, ";
                if (isUpdateShopRemark)
                    UpdateFieldsList += "[ShopRemark] = @ShopRemark, ";
                if (isUpdateShopDateTime)
                    UpdateFieldsList += "[ShopDateTime] = @ShopDateTime, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateGoodSalesID ? null : new MSSQL.Parameter("GoodSalesID", SqlDbType.BigInt, 0, ParameterDirection.Input, GoodSalesID),
                    !isUpdateUserName ? null : new MSSQL.Parameter("UserName", SqlDbType.VarChar, 0, ParameterDirection.Input, UserName),
                    !isUpdateAddress ? null : new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address),
                    !isUpdateTel ? null : new MSSQL.Parameter("Tel", SqlDbType.VarChar, 0, ParameterDirection.Input, Tel),
                    !isUpdateOrderNo ? null : new MSSQL.Parameter("OrderNo", SqlDbType.VarChar, 0, ParameterDirection.Input, OrderNo),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateStatus ? null : new MSSQL.Parameter("Status", SqlDbType.Bit, 0, ParameterDirection.Input, Status),
                    !isUpdateUserRemark ? null : new MSSQL.Parameter("UserRemark", SqlDbType.VarChar, 0, ParameterDirection.Input, UserRemark),
                    !isUpdateShopRemark ? null : new MSSQL.Parameter("ShopRemark", SqlDbType.VarChar, 0, ParameterDirection.Input, ShopRemark),
                    !isUpdateShopDateTime ? null : new MSSQL.Parameter("ShopDateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, ShopDateTime)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_Shipment]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_Shipment]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_GoodType
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_GoodType]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(string TypeName, bool isInsertTypeName, string TypePic, bool isInsertTypePic, string TypeNorm, bool isInsertTypeNorm, string Remark, bool isInsertRemark, bool Isuse, bool isInsertIsuse, double Price, bool isInsertPrice, bool IsLimit, bool isInsertIsLimit, bool IsVirtualSales, bool isInsertIsVirtualSales, bool IsBvSales, bool isInsertIsBvSales, double Price2, bool isInsertPrice2, double Price3, bool isInsertPrice3, double Price4, bool isInsertPrice4, string GoodNorm, bool isInsertGoodNorm, string GoodColor, bool isInsertGoodColor)
            {
                string CommandText = "insert into [T_GoodType] (";
                string InsertFieldsList = "";

                if (isInsertTypeName)
                    InsertFieldsList += "[TypeName], ";
                if (isInsertTypePic)
                    InsertFieldsList += "[TypePic], ";
                if (isInsertTypeNorm)
                    InsertFieldsList += "[TypeNorm], ";
                if (isInsertRemark)
                    InsertFieldsList += "[Remark], ";
                if (isInsertIsuse)
                    InsertFieldsList += "[Isuse], ";
                if (isInsertPrice)
                    InsertFieldsList += "[Price], ";
                if (isInsertIsLimit)
                    InsertFieldsList += "[IsLimit], ";
                if (isInsertIsVirtualSales)
                    InsertFieldsList += "[IsVirtualSales], ";
                if (isInsertIsBvSales)
                    InsertFieldsList += "[IsBvSales], ";
                if (isInsertPrice2)
                    InsertFieldsList += "[Price2], ";
                if (isInsertPrice3)
                    InsertFieldsList += "[Price3], ";
                if (isInsertPrice4)
                    InsertFieldsList += "[Price4], ";
                if (isInsertGoodNorm)
                    InsertFieldsList += "[GoodNorm], ";
                if (isInsertGoodColor)
                    InsertFieldsList += "[GoodColor], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertTypeName)
                    InsertValuesList += "@TypeName, ";
                if (isInsertTypePic)
                    InsertValuesList += "@TypePic, ";
                if (isInsertTypeNorm)
                    InsertValuesList += "@TypeNorm, ";
                if (isInsertRemark)
                    InsertValuesList += "@Remark, ";
                if (isInsertIsuse)
                    InsertValuesList += "@Isuse, ";
                if (isInsertPrice)
                    InsertValuesList += "@Price, ";
                if (isInsertIsLimit)
                    InsertValuesList += "@IsLimit, ";
                if (isInsertIsVirtualSales)
                    InsertValuesList += "@IsVirtualSales, ";
                if (isInsertIsBvSales)
                    InsertValuesList += "@IsBvSales, ";
                if (isInsertPrice2)
                    InsertValuesList += "@Price2, ";
                if (isInsertPrice3)
                    InsertValuesList += "@Price3, ";
                if (isInsertPrice4)
                    InsertValuesList += "@Price4, ";
                if (isInsertGoodNorm)
                    InsertValuesList += "@GoodNorm, ";
                if (isInsertGoodColor)
                    InsertValuesList += "@GoodColor, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertTypeName ? null : new MSSQL.Parameter("TypeName", SqlDbType.VarChar, 0, ParameterDirection.Input, TypeName),
                    !isInsertTypePic ? null : new MSSQL.Parameter("TypePic", SqlDbType.VarChar, 0, ParameterDirection.Input, TypePic),
                    !isInsertTypeNorm ? null : new MSSQL.Parameter("TypeNorm", SqlDbType.VarChar, 0, ParameterDirection.Input, TypeNorm),
                    !isInsertRemark ? null : new MSSQL.Parameter("Remark", SqlDbType.VarChar, 0, ParameterDirection.Input, Remark),
                    !isInsertIsuse ? null : new MSSQL.Parameter("Isuse", SqlDbType.Bit, 0, ParameterDirection.Input, Isuse),
                    !isInsertPrice ? null : new MSSQL.Parameter("Price", SqlDbType.Money, 0, ParameterDirection.Input, Price),
                    !isInsertIsLimit ? null : new MSSQL.Parameter("IsLimit", SqlDbType.Bit, 0, ParameterDirection.Input, IsLimit),
                    !isInsertIsVirtualSales ? null : new MSSQL.Parameter("IsVirtualSales", SqlDbType.Bit, 0, ParameterDirection.Input, IsVirtualSales),
                    !isInsertIsBvSales ? null : new MSSQL.Parameter("IsBvSales", SqlDbType.Bit, 0, ParameterDirection.Input, IsBvSales),
                    !isInsertPrice2 ? null : new MSSQL.Parameter("Price2", SqlDbType.Money, 0, ParameterDirection.Input, Price2),
                    !isInsertPrice3 ? null : new MSSQL.Parameter("Price3", SqlDbType.Money, 0, ParameterDirection.Input, Price3),
                    !isInsertPrice4 ? null : new MSSQL.Parameter("Price4", SqlDbType.Money, 0, ParameterDirection.Input, Price4),
                    !isInsertGoodNorm ? null : new MSSQL.Parameter("GoodNorm", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodNorm),
                    !isInsertGoodColor ? null : new MSSQL.Parameter("GoodColor", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodColor)
                    );
            }

            public static int Update(string Condition, string TypeName, bool isUpdateTypeName, string TypePic, bool isUpdateTypePic, string TypeNorm, bool isUpdateTypeNorm, string Remark, bool isUpdateRemark, bool Isuse, bool isUpdateIsuse, double Price, bool isUpdatePrice, bool IsLimit, bool isUpdateIsLimit, bool IsVirtualSales, bool isUpdateIsVirtualSales, bool IsBvSales, bool isUpdateIsBvSales, double Price2, bool isUpdatePrice2, double Price3, bool isUpdatePrice3, double Price4, bool isUpdatePrice4, string GoodNorm, bool isUpdateGoodNorm, string GoodColor, bool isUpdateGoodColor)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_GoodType] set ";
                string UpdateFieldsList = "";

                if (isUpdateTypeName)
                    UpdateFieldsList += "[TypeName] = @TypeName, ";
                if (isUpdateTypePic)
                    UpdateFieldsList += "[TypePic] = @TypePic, ";
                if (isUpdateTypeNorm)
                    UpdateFieldsList += "[TypeNorm] = @TypeNorm, ";
                if (isUpdateRemark)
                    UpdateFieldsList += "[Remark] = @Remark, ";
                if (isUpdateIsuse)
                    UpdateFieldsList += "[Isuse] = @Isuse, ";
                if (isUpdatePrice)
                    UpdateFieldsList += "[Price] = @Price, ";
                if (isUpdateIsLimit)
                    UpdateFieldsList += "[IsLimit] = @IsLimit, ";
                if (isUpdateIsVirtualSales)
                    UpdateFieldsList += "[IsVirtualSales] = @IsVirtualSales, ";
                if (isUpdateIsBvSales)
                    UpdateFieldsList += "[IsBvSales] = @IsBvSales, ";
                if (isUpdatePrice2)
                    UpdateFieldsList += "[Price2] = @Price2, ";
                if (isUpdatePrice3)
                    UpdateFieldsList += "[Price3] = @Price3, ";
                if (isUpdatePrice4)
                    UpdateFieldsList += "[Price4] = @Price4, ";
                if (isUpdateGoodNorm)
                    UpdateFieldsList += "[GoodNorm] = @GoodNorm, ";
                if (isUpdateGoodColor)
                    UpdateFieldsList += "[GoodColor] = @GoodColor, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateTypeName ? null : new MSSQL.Parameter("TypeName", SqlDbType.VarChar, 0, ParameterDirection.Input, TypeName),
                    !isUpdateTypePic ? null : new MSSQL.Parameter("TypePic", SqlDbType.VarChar, 0, ParameterDirection.Input, TypePic),
                    !isUpdateTypeNorm ? null : new MSSQL.Parameter("TypeNorm", SqlDbType.VarChar, 0, ParameterDirection.Input, TypeNorm),
                    !isUpdateRemark ? null : new MSSQL.Parameter("Remark", SqlDbType.VarChar, 0, ParameterDirection.Input, Remark),
                    !isUpdateIsuse ? null : new MSSQL.Parameter("Isuse", SqlDbType.Bit, 0, ParameterDirection.Input, Isuse),
                    !isUpdatePrice ? null : new MSSQL.Parameter("Price", SqlDbType.Money, 0, ParameterDirection.Input, Price),
                    !isUpdateIsLimit ? null : new MSSQL.Parameter("IsLimit", SqlDbType.Bit, 0, ParameterDirection.Input, IsLimit),
                    !isUpdateIsVirtualSales ? null : new MSSQL.Parameter("IsVirtualSales", SqlDbType.Bit, 0, ParameterDirection.Input, IsVirtualSales),
                    !isUpdateIsBvSales ? null : new MSSQL.Parameter("IsBvSales", SqlDbType.Bit, 0, ParameterDirection.Input, IsBvSales),
                    !isUpdatePrice2 ? null : new MSSQL.Parameter("Price2", SqlDbType.Money, 0, ParameterDirection.Input, Price2),
                    !isUpdatePrice3 ? null : new MSSQL.Parameter("Price3", SqlDbType.Money, 0, ParameterDirection.Input, Price3),
                    !isUpdatePrice4 ? null : new MSSQL.Parameter("Price4", SqlDbType.Money, 0, ParameterDirection.Input, Price4),
                    !isUpdateGoodNorm ? null : new MSSQL.Parameter("GoodNorm", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodNorm),
                    !isUpdateGoodColor ? null : new MSSQL.Parameter("GoodColor", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodColor)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_GoodType]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_GoodType]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_Banks
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_Banks]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(string Name, bool isInsertName, short Order, bool isInsertOrder)
            {
                string CommandText = "insert into [T_Banks] (";
                string InsertFieldsList = "";

                if (isInsertName)
                    InsertFieldsList += "[Name], ";
                if (isInsertOrder)
                    InsertFieldsList += "[Order], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertName)
                    InsertValuesList += "@Name, ";
                if (isInsertOrder)
                    InsertValuesList += "@Order, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    !isInsertOrder ? null : new MSSQL.Parameter("Order", SqlDbType.SmallInt, 0, ParameterDirection.Input, Order)
                    );
            }

            public static int Update(string Condition, string Name, bool isUpdateName, short Order, bool isUpdateOrder)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_Banks] set ";
                string UpdateFieldsList = "";

                if (isUpdateName)
                    UpdateFieldsList += "[Name] = @Name, ";
                if (isUpdateOrder)
                    UpdateFieldsList += "[Order] = @Order, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    !isUpdateOrder ? null : new MSSQL.Parameter("Order", SqlDbType.SmallInt, 0, ParameterDirection.Input, Order)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_Banks]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_Banks]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_UsersSubsOfDay
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_UsersSubsOfDay]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(int Year, bool isInsertYear, int Month, bool isInsertMonth, int Day, bool isInsertDay, long UserID, bool isInsertUserID, double L, bool isInsertL, double R, bool isInsertR, double LDistilled, bool isInsertLDistilled, double RDistilled, bool isInsertRDistilled)
            {
                string CommandText = "insert into [T_UsersSubsOfDay] (";
                string InsertFieldsList = "";

                if (isInsertYear)
                    InsertFieldsList += "[Year], ";
                if (isInsertMonth)
                    InsertFieldsList += "[Month], ";
                if (isInsertDay)
                    InsertFieldsList += "[Day], ";
                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertL)
                    InsertFieldsList += "[L], ";
                if (isInsertR)
                    InsertFieldsList += "[R], ";
                if (isInsertLDistilled)
                    InsertFieldsList += "[LDistilled], ";
                if (isInsertRDistilled)
                    InsertFieldsList += "[RDistilled], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertYear)
                    InsertValuesList += "@Year, ";
                if (isInsertMonth)
                    InsertValuesList += "@Month, ";
                if (isInsertDay)
                    InsertValuesList += "@Day, ";
                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertL)
                    InsertValuesList += "@L, ";
                if (isInsertR)
                    InsertValuesList += "@R, ";
                if (isInsertLDistilled)
                    InsertValuesList += "@LDistilled, ";
                if (isInsertRDistilled)
                    InsertValuesList += "@RDistilled, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertYear ? null : new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year),
                    !isInsertMonth ? null : new MSSQL.Parameter("Month", SqlDbType.Int, 0, ParameterDirection.Input, Month),
                    !isInsertDay ? null : new MSSQL.Parameter("Day", SqlDbType.Int, 0, ParameterDirection.Input, Day),
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertL ? null : new MSSQL.Parameter("L", SqlDbType.Float, 0, ParameterDirection.Input, L),
                    !isInsertR ? null : new MSSQL.Parameter("R", SqlDbType.Float, 0, ParameterDirection.Input, R),
                    !isInsertLDistilled ? null : new MSSQL.Parameter("LDistilled", SqlDbType.Float, 0, ParameterDirection.Input, LDistilled),
                    !isInsertRDistilled ? null : new MSSQL.Parameter("RDistilled", SqlDbType.Float, 0, ParameterDirection.Input, RDistilled)
                    );
            }

            public static int Update(string Condition, int Year, bool isUpdateYear, int Month, bool isUpdateMonth, int Day, bool isUpdateDay, long UserID, bool isUpdateUserID, double L, bool isUpdateL, double R, bool isUpdateR, double LDistilled, bool isUpdateLDistilled, double RDistilled, bool isUpdateRDistilled)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_UsersSubsOfDay] set ";
                string UpdateFieldsList = "";

                if (isUpdateYear)
                    UpdateFieldsList += "[Year] = @Year, ";
                if (isUpdateMonth)
                    UpdateFieldsList += "[Month] = @Month, ";
                if (isUpdateDay)
                    UpdateFieldsList += "[Day] = @Day, ";
                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateL)
                    UpdateFieldsList += "[L] = @L, ";
                if (isUpdateR)
                    UpdateFieldsList += "[R] = @R, ";
                if (isUpdateLDistilled)
                    UpdateFieldsList += "[LDistilled] = @LDistilled, ";
                if (isUpdateRDistilled)
                    UpdateFieldsList += "[RDistilled] = @RDistilled, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateYear ? null : new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year),
                    !isUpdateMonth ? null : new MSSQL.Parameter("Month", SqlDbType.Int, 0, ParameterDirection.Input, Month),
                    !isUpdateDay ? null : new MSSQL.Parameter("Day", SqlDbType.Int, 0, ParameterDirection.Input, Day),
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateL ? null : new MSSQL.Parameter("L", SqlDbType.Float, 0, ParameterDirection.Input, L),
                    !isUpdateR ? null : new MSSQL.Parameter("R", SqlDbType.Float, 0, ParameterDirection.Input, R),
                    !isUpdateLDistilled ? null : new MSSQL.Parameter("LDistilled", SqlDbType.Float, 0, ParameterDirection.Input, LDistilled),
                    !isUpdateRDistilled ? null : new MSSQL.Parameter("RDistilled", SqlDbType.Float, 0, ParameterDirection.Input, RDistilled)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_UsersSubsOfDay]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_UsersSubsOfDay]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_PaymentFiles
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_PaymentFiles]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(string FileName, bool isInsertFileName, DateTime DateTime, bool isInsertDateTime, int Result, bool isInsertResult, long HandleOperatorID, bool isInsertHandleOperatorID, int Type, bool isInsertType)
            {
                string CommandText = "insert into [T_PaymentFiles] (";
                string InsertFieldsList = "";

                if (isInsertFileName)
                    InsertFieldsList += "[FileName], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertResult)
                    InsertFieldsList += "[Result], ";
                if (isInsertHandleOperatorID)
                    InsertFieldsList += "[HandleOperatorID], ";
                if (isInsertType)
                    InsertFieldsList += "[Type], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertFileName)
                    InsertValuesList += "@FileName, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertResult)
                    InsertValuesList += "@Result, ";
                if (isInsertHandleOperatorID)
                    InsertValuesList += "@HandleOperatorID, ";
                if (isInsertType)
                    InsertValuesList += "@Type, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertFileName ? null : new MSSQL.Parameter("FileName", SqlDbType.VarChar, 0, ParameterDirection.Input, FileName),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertResult ? null : new MSSQL.Parameter("Result", SqlDbType.Int, 0, ParameterDirection.Input, Result),
                    !isInsertHandleOperatorID ? null : new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    !isInsertType ? null : new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type)
                    );
            }

            public static int Update(string Condition, string FileName, bool isUpdateFileName, DateTime DateTime, bool isUpdateDateTime, int Result, bool isUpdateResult, long HandleOperatorID, bool isUpdateHandleOperatorID, int Type, bool isUpdateType)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_PaymentFiles] set ";
                string UpdateFieldsList = "";

                if (isUpdateFileName)
                    UpdateFieldsList += "[FileName] = @FileName, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateResult)
                    UpdateFieldsList += "[Result] = @Result, ";
                if (isUpdateHandleOperatorID)
                    UpdateFieldsList += "[HandleOperatorID] = @HandleOperatorID, ";
                if (isUpdateType)
                    UpdateFieldsList += "[Type] = @Type, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateFileName ? null : new MSSQL.Parameter("FileName", SqlDbType.VarChar, 0, ParameterDirection.Input, FileName),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateResult ? null : new MSSQL.Parameter("Result", SqlDbType.Int, 0, ParameterDirection.Input, Result),
                    !isUpdateHandleOperatorID ? null : new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    !isUpdateType ? null : new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_PaymentFiles]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_PaymentFiles]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_UserPayDetails
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_UserPayDetails]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, DateTime DateTime, bool isInsertDateTime, string PayType, bool isInsertPayType, double Money, bool isInsertMoney, double FormalitiesFees, bool isInsertFormalitiesFees, short Result, bool isInsertResult)
            {
                string CommandText = "insert into [T_UserPayDetails] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertPayType)
                    InsertFieldsList += "[PayType], ";
                if (isInsertMoney)
                    InsertFieldsList += "[Money], ";
                if (isInsertFormalitiesFees)
                    InsertFieldsList += "[FormalitiesFees], ";
                if (isInsertResult)
                    InsertFieldsList += "[Result], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertPayType)
                    InsertValuesList += "@PayType, ";
                if (isInsertMoney)
                    InsertValuesList += "@Money, ";
                if (isInsertFormalitiesFees)
                    InsertValuesList += "@FormalitiesFees, ";
                if (isInsertResult)
                    InsertValuesList += "@Result, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertPayType ? null : new MSSQL.Parameter("PayType", SqlDbType.VarChar, 0, ParameterDirection.Input, PayType),
                    !isInsertMoney ? null : new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    !isInsertFormalitiesFees ? null : new MSSQL.Parameter("FormalitiesFees", SqlDbType.Money, 0, ParameterDirection.Input, FormalitiesFees),
                    !isInsertResult ? null : new MSSQL.Parameter("Result", SqlDbType.SmallInt, 0, ParameterDirection.Input, Result)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, DateTime DateTime, bool isUpdateDateTime, string PayType, bool isUpdatePayType, double Money, bool isUpdateMoney, double FormalitiesFees, bool isUpdateFormalitiesFees, short Result, bool isUpdateResult)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_UserPayDetails] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdatePayType)
                    UpdateFieldsList += "[PayType] = @PayType, ";
                if (isUpdateMoney)
                    UpdateFieldsList += "[Money] = @Money, ";
                if (isUpdateFormalitiesFees)
                    UpdateFieldsList += "[FormalitiesFees] = @FormalitiesFees, ";
                if (isUpdateResult)
                    UpdateFieldsList += "[Result] = @Result, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdatePayType ? null : new MSSQL.Parameter("PayType", SqlDbType.VarChar, 0, ParameterDirection.Input, PayType),
                    !isUpdateMoney ? null : new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    !isUpdateFormalitiesFees ? null : new MSSQL.Parameter("FormalitiesFees", SqlDbType.Money, 0, ParameterDirection.Input, FormalitiesFees),
                    !isUpdateResult ? null : new MSSQL.Parameter("Result", SqlDbType.SmallInt, 0, ParameterDirection.Input, Result)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_UserPayDetails]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_UserPayDetails]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_UserRiskMoney
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_UserRiskMoney]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, double RiskMoney, bool isInsertRiskMoney, DateTime DateTime, bool isInsertDateTime)
            {
                string CommandText = "insert into [T_UserRiskMoney] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertRiskMoney)
                    InsertFieldsList += "[RiskMoney], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertRiskMoney)
                    InsertValuesList += "@RiskMoney, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertRiskMoney ? null : new MSSQL.Parameter("RiskMoney", SqlDbType.Money, 0, ParameterDirection.Input, RiskMoney),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, double RiskMoney, bool isUpdateRiskMoney, DateTime DateTime, bool isUpdateDateTime)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_UserRiskMoney] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateRiskMoney)
                    UpdateFieldsList += "[RiskMoney] = @RiskMoney, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateRiskMoney ? null : new MSSQL.Parameter("RiskMoney", SqlDbType.Money, 0, ParameterDirection.Input, RiskMoney),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_UserRiskMoney]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_UserRiskMoney]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_UserDistills
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_UserDistills]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, DateTime DateTime, bool isInsertDateTime, double Money, bool isInsertMoney, string BankTypeName, bool isInsertBankTypeName, string BankCardNumber, bool isInsertBankCardNumber, string Memo, bool isInsertMemo, long HandleOperatorID, bool isInsertHandleOperatorID, bool isPersonal, bool isInsertisPersonal, int PaymentType, bool isInsertPaymentType, long PaymentFilesID, bool isInsertPaymentFilesID, int Type, bool isInsertType, int Result, bool isInsertResult)
            {
                string CommandText = "insert into [T_UserDistills] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertMoney)
                    InsertFieldsList += "[Money], ";
                if (isInsertBankTypeName)
                    InsertFieldsList += "[BankTypeName], ";
                if (isInsertBankCardNumber)
                    InsertFieldsList += "[BankCardNumber], ";
                if (isInsertMemo)
                    InsertFieldsList += "[Memo], ";
                if (isInsertHandleOperatorID)
                    InsertFieldsList += "[HandleOperatorID], ";
                if (isInsertisPersonal)
                    InsertFieldsList += "[isPersonal], ";
                if (isInsertPaymentType)
                    InsertFieldsList += "[PaymentType], ";
                if (isInsertPaymentFilesID)
                    InsertFieldsList += "[PaymentFilesID], ";
                if (isInsertType)
                    InsertFieldsList += "[Type], ";
                if (isInsertResult)
                    InsertFieldsList += "[Result], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertMoney)
                    InsertValuesList += "@Money, ";
                if (isInsertBankTypeName)
                    InsertValuesList += "@BankTypeName, ";
                if (isInsertBankCardNumber)
                    InsertValuesList += "@BankCardNumber, ";
                if (isInsertMemo)
                    InsertValuesList += "@Memo, ";
                if (isInsertHandleOperatorID)
                    InsertValuesList += "@HandleOperatorID, ";
                if (isInsertisPersonal)
                    InsertValuesList += "@isPersonal, ";
                if (isInsertPaymentType)
                    InsertValuesList += "@PaymentType, ";
                if (isInsertPaymentFilesID)
                    InsertValuesList += "@PaymentFilesID, ";
                if (isInsertType)
                    InsertValuesList += "@Type, ";
                if (isInsertResult)
                    InsertValuesList += "@Result, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertMoney ? null : new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    !isInsertBankTypeName ? null : new MSSQL.Parameter("BankTypeName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankTypeName),
                    !isInsertBankCardNumber ? null : new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    !isInsertMemo ? null : new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    !isInsertHandleOperatorID ? null : new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    !isInsertisPersonal ? null : new MSSQL.Parameter("isPersonal", SqlDbType.Bit, 0, ParameterDirection.Input, isPersonal),
                    !isInsertPaymentType ? null : new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    !isInsertPaymentFilesID ? null : new MSSQL.Parameter("PaymentFilesID", SqlDbType.BigInt, 0, ParameterDirection.Input, PaymentFilesID),
                    !isInsertType ? null : new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    !isInsertResult ? null : new MSSQL.Parameter("Result", SqlDbType.Int, 0, ParameterDirection.Input, Result)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, DateTime DateTime, bool isUpdateDateTime, double Money, bool isUpdateMoney, string BankTypeName, bool isUpdateBankTypeName, string BankCardNumber, bool isUpdateBankCardNumber, string Memo, bool isUpdateMemo, long HandleOperatorID, bool isUpdateHandleOperatorID, bool isPersonal, bool isUpdateisPersonal, int PaymentType, bool isUpdatePaymentType, long PaymentFilesID, bool isUpdatePaymentFilesID, int Type, bool isUpdateType, int Result, bool isUpdateResult)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_UserDistills] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateMoney)
                    UpdateFieldsList += "[Money] = @Money, ";
                if (isUpdateBankTypeName)
                    UpdateFieldsList += "[BankTypeName] = @BankTypeName, ";
                if (isUpdateBankCardNumber)
                    UpdateFieldsList += "[BankCardNumber] = @BankCardNumber, ";
                if (isUpdateMemo)
                    UpdateFieldsList += "[Memo] = @Memo, ";
                if (isUpdateHandleOperatorID)
                    UpdateFieldsList += "[HandleOperatorID] = @HandleOperatorID, ";
                if (isUpdateisPersonal)
                    UpdateFieldsList += "[isPersonal] = @isPersonal, ";
                if (isUpdatePaymentType)
                    UpdateFieldsList += "[PaymentType] = @PaymentType, ";
                if (isUpdatePaymentFilesID)
                    UpdateFieldsList += "[PaymentFilesID] = @PaymentFilesID, ";
                if (isUpdateType)
                    UpdateFieldsList += "[Type] = @Type, ";
                if (isUpdateResult)
                    UpdateFieldsList += "[Result] = @Result, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateMoney ? null : new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    !isUpdateBankTypeName ? null : new MSSQL.Parameter("BankTypeName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankTypeName),
                    !isUpdateBankCardNumber ? null : new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    !isUpdateMemo ? null : new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    !isUpdateHandleOperatorID ? null : new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    !isUpdateisPersonal ? null : new MSSQL.Parameter("isPersonal", SqlDbType.Bit, 0, ParameterDirection.Input, isPersonal),
                    !isUpdatePaymentType ? null : new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    !isUpdatePaymentFilesID ? null : new MSSQL.Parameter("PaymentFilesID", SqlDbType.BigInt, 0, ParameterDirection.Input, PaymentFilesID),
                    !isUpdateType ? null : new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    !isUpdateResult ? null : new MSSQL.Parameter("Result", SqlDbType.Int, 0, ParameterDirection.Input, Result)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_UserDistills]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_UserDistills]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_WaitSendEmail
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_WaitSendEmail]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(byte[] MailTo, bool isInsertMailTo, byte[] Subject, bool isInsertSubject, byte[] Body, bool isInsertBody, bool isSended, bool isInsertisSended, int Result, bool isInsertResult)
            {
                string CommandText = "insert into [T_WaitSendEmail] (";
                string InsertFieldsList = "";

                if (isInsertMailTo)
                    InsertFieldsList += "[MailTo], ";
                if (isInsertSubject)
                    InsertFieldsList += "[Subject], ";
                if (isInsertBody)
                    InsertFieldsList += "[Body], ";
                if (isInsertisSended)
                    InsertFieldsList += "[isSended], ";
                if (isInsertResult)
                    InsertFieldsList += "[Result], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertMailTo)
                    InsertValuesList += "@MailTo, ";
                if (isInsertSubject)
                    InsertValuesList += "@Subject, ";
                if (isInsertBody)
                    InsertValuesList += "@Body, ";
                if (isInsertisSended)
                    InsertValuesList += "@isSended, ";
                if (isInsertResult)
                    InsertValuesList += "@Result, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertMailTo ? null : new MSSQL.Parameter("MailTo", SqlDbType.Image, 0, ParameterDirection.Input, MailTo),
                    !isInsertSubject ? null : new MSSQL.Parameter("Subject", SqlDbType.Image, 0, ParameterDirection.Input, Subject),
                    !isInsertBody ? null : new MSSQL.Parameter("Body", SqlDbType.Image, 0, ParameterDirection.Input, Body),
                    !isInsertisSended ? null : new MSSQL.Parameter("isSended", SqlDbType.Bit, 0, ParameterDirection.Input, isSended),
                    !isInsertResult ? null : new MSSQL.Parameter("Result", SqlDbType.Int, 0, ParameterDirection.Input, Result)
                    );
            }

            public static int Update(string Condition, byte[] MailTo, bool isUpdateMailTo, byte[] Subject, bool isUpdateSubject, byte[] Body, bool isUpdateBody, bool isSended, bool isUpdateisSended, int Result, bool isUpdateResult)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_WaitSendEmail] set ";
                string UpdateFieldsList = "";

                if (isUpdateMailTo)
                    UpdateFieldsList += "[MailTo] = @MailTo, ";
                if (isUpdateSubject)
                    UpdateFieldsList += "[Subject] = @Subject, ";
                if (isUpdateBody)
                    UpdateFieldsList += "[Body] = @Body, ";
                if (isUpdateisSended)
                    UpdateFieldsList += "[isSended] = @isSended, ";
                if (isUpdateResult)
                    UpdateFieldsList += "[Result] = @Result, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateMailTo ? null : new MSSQL.Parameter("MailTo", SqlDbType.Image, 0, ParameterDirection.Input, MailTo),
                    !isUpdateSubject ? null : new MSSQL.Parameter("Subject", SqlDbType.Image, 0, ParameterDirection.Input, Subject),
                    !isUpdateBody ? null : new MSSQL.Parameter("Body", SqlDbType.Image, 0, ParameterDirection.Input, Body),
                    !isUpdateisSended ? null : new MSSQL.Parameter("isSended", SqlDbType.Bit, 0, ParameterDirection.Input, isSended),
                    !isUpdateResult ? null : new MSSQL.Parameter("Result", SqlDbType.Int, 0, ParameterDirection.Input, Result)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_WaitSendEmail]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_WaitSendEmail]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_Cost
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_Cost]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long HandleOperatorID, bool isInsertHandleOperatorID, DateTime DateTime, bool isInsertDateTime, double Cost, bool isInsertCost, double RealCost, bool isInsertRealCost)
            {
                string CommandText = "insert into [T_Cost] (";
                string InsertFieldsList = "";

                if (isInsertHandleOperatorID)
                    InsertFieldsList += "[HandleOperatorID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertCost)
                    InsertFieldsList += "[Cost], ";
                if (isInsertRealCost)
                    InsertFieldsList += "[RealCost], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertHandleOperatorID)
                    InsertValuesList += "@HandleOperatorID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertCost)
                    InsertValuesList += "@Cost, ";
                if (isInsertRealCost)
                    InsertValuesList += "@RealCost, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertHandleOperatorID ? null : new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertCost ? null : new MSSQL.Parameter("Cost", SqlDbType.Money, 0, ParameterDirection.Input, Cost),
                    !isInsertRealCost ? null : new MSSQL.Parameter("RealCost", SqlDbType.Money, 0, ParameterDirection.Input, RealCost)
                    );
            }

            public static int Update(string Condition, long HandleOperatorID, bool isUpdateHandleOperatorID, DateTime DateTime, bool isUpdateDateTime, double Cost, bool isUpdateCost, double RealCost, bool isUpdateRealCost)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_Cost] set ";
                string UpdateFieldsList = "";

                if (isUpdateHandleOperatorID)
                    UpdateFieldsList += "[HandleOperatorID] = @HandleOperatorID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateCost)
                    UpdateFieldsList += "[Cost] = @Cost, ";
                if (isUpdateRealCost)
                    UpdateFieldsList += "[RealCost] = @RealCost, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateHandleOperatorID ? null : new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateCost ? null : new MSSQL.Parameter("Cost", SqlDbType.Money, 0, ParameterDirection.Input, Cost),
                    !isUpdateRealCost ? null : new MSSQL.Parameter("RealCost", SqlDbType.Money, 0, ParameterDirection.Input, RealCost)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_Cost]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_Cost]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_FundManage
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_FundManage]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, DateTime DateTime, bool isInsertDateTime, double Money, bool isInsertMoney)
            {
                string CommandText = "insert into [T_FundManage] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertMoney)
                    InsertFieldsList += "[Money], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertMoney)
                    InsertValuesList += "@Money, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertMoney ? null : new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, DateTime DateTime, bool isUpdateDateTime, double Money, bool isUpdateMoney)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_FundManage] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateMoney)
                    UpdateFieldsList += "[Money] = @Money, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateMoney ? null : new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_FundManage]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_FundManage]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_Nets_2
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_Nets_2]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, DateTime DateTime, bool isInsertDateTime, long ParentNetID, bool isInsertParentNetID, int LR, bool isInsertLR, string UserName, bool isInsertUserName)
            {
                string CommandText = "insert into [T_Nets_2] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertParentNetID)
                    InsertFieldsList += "[ParentNetID], ";
                if (isInsertLR)
                    InsertFieldsList += "[LR], ";
                if (isInsertUserName)
                    InsertFieldsList += "[UserName], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertParentNetID)
                    InsertValuesList += "@ParentNetID, ";
                if (isInsertLR)
                    InsertValuesList += "@LR, ";
                if (isInsertUserName)
                    InsertValuesList += "@UserName, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertParentNetID ? null : new MSSQL.Parameter("ParentNetID", SqlDbType.BigInt, 0, ParameterDirection.Input, ParentNetID),
                    !isInsertLR ? null : new MSSQL.Parameter("LR", SqlDbType.Int, 0, ParameterDirection.Input, LR),
                    !isInsertUserName ? null : new MSSQL.Parameter("UserName", SqlDbType.VarChar, 0, ParameterDirection.Input, UserName)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, DateTime DateTime, bool isUpdateDateTime, long ParentNetID, bool isUpdateParentNetID, int LR, bool isUpdateLR, string UserName, bool isUpdateUserName)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_Nets_2] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateParentNetID)
                    UpdateFieldsList += "[ParentNetID] = @ParentNetID, ";
                if (isUpdateLR)
                    UpdateFieldsList += "[LR] = @LR, ";
                if (isUpdateUserName)
                    UpdateFieldsList += "[UserName] = @UserName, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateParentNetID ? null : new MSSQL.Parameter("ParentNetID", SqlDbType.BigInt, 0, ParameterDirection.Input, ParentNetID),
                    !isUpdateLR ? null : new MSSQL.Parameter("LR", SqlDbType.Int, 0, ParameterDirection.Input, LR),
                    !isUpdateUserName ? null : new MSSQL.Parameter("UserName", SqlDbType.VarChar, 0, ParameterDirection.Input, UserName)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_Nets_2]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_Nets_2]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_Options
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_Options]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(short ID, bool isInsertID, string Group, bool isInsertGroup, string Name, bool isInsertName, string Key, bool isInsertKey, string Value, bool isInsertValue, byte[] ValueBinary, bool isInsertValueBinary, string Description, bool isInsertDescription, bool isCanEdit, bool isInsertisCanEdit)
            {
                string CommandText = "insert into [T_Options] (";
                string InsertFieldsList = "";

                if (isInsertID)
                    InsertFieldsList += "[ID], ";
                if (isInsertGroup)
                    InsertFieldsList += "[Group], ";
                if (isInsertName)
                    InsertFieldsList += "[Name], ";
                if (isInsertKey)
                    InsertFieldsList += "[Key], ";
                if (isInsertValue)
                    InsertFieldsList += "[Value], ";
                if (isInsertValueBinary)
                    InsertFieldsList += "[ValueBinary], ";
                if (isInsertDescription)
                    InsertFieldsList += "[Description], ";
                if (isInsertisCanEdit)
                    InsertFieldsList += "[isCanEdit], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertID)
                    InsertValuesList += "@ID, ";
                if (isInsertGroup)
                    InsertValuesList += "@Group, ";
                if (isInsertName)
                    InsertValuesList += "@Name, ";
                if (isInsertKey)
                    InsertValuesList += "@Key, ";
                if (isInsertValue)
                    InsertValuesList += "@Value, ";
                if (isInsertValueBinary)
                    InsertValuesList += "@ValueBinary, ";
                if (isInsertDescription)
                    InsertValuesList += "@Description, ";
                if (isInsertisCanEdit)
                    InsertValuesList += "@isCanEdit, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertID ? null : new MSSQL.Parameter("ID", SqlDbType.SmallInt, 0, ParameterDirection.Input, ID),
                    !isInsertGroup ? null : new MSSQL.Parameter("Group", SqlDbType.VarChar, 0, ParameterDirection.Input, Group),
                    !isInsertName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    !isInsertKey ? null : new MSSQL.Parameter("Key", SqlDbType.VarChar, 0, ParameterDirection.Input, Key),
                    !isInsertValue ? null : new MSSQL.Parameter("Value", SqlDbType.VarChar, 0, ParameterDirection.Input, Value),
                    !isInsertValueBinary ? null : new MSSQL.Parameter("ValueBinary", SqlDbType.Image, 0, ParameterDirection.Input, ValueBinary),
                    !isInsertDescription ? null : new MSSQL.Parameter("Description", SqlDbType.VarChar, 0, ParameterDirection.Input, Description),
                    !isInsertisCanEdit ? null : new MSSQL.Parameter("isCanEdit", SqlDbType.Bit, 0, ParameterDirection.Input, isCanEdit)
                    );
            }

            public static int Update(string Condition, short ID, bool isUpdateID, string Group, bool isUpdateGroup, string Name, bool isUpdateName, string Key, bool isUpdateKey, string Value, bool isUpdateValue, byte[] ValueBinary, bool isUpdateValueBinary, string Description, bool isUpdateDescription, bool isCanEdit, bool isUpdateisCanEdit)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_Options] set ";
                string UpdateFieldsList = "";

                if (isUpdateID)
                    UpdateFieldsList += "[ID] = @ID, ";
                if (isUpdateGroup)
                    UpdateFieldsList += "[Group] = @Group, ";
                if (isUpdateName)
                    UpdateFieldsList += "[Name] = @Name, ";
                if (isUpdateKey)
                    UpdateFieldsList += "[Key] = @Key, ";
                if (isUpdateValue)
                    UpdateFieldsList += "[Value] = @Value, ";
                if (isUpdateValueBinary)
                    UpdateFieldsList += "[ValueBinary] = @ValueBinary, ";
                if (isUpdateDescription)
                    UpdateFieldsList += "[Description] = @Description, ";
                if (isUpdateisCanEdit)
                    UpdateFieldsList += "[isCanEdit] = @isCanEdit, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateID ? null : new MSSQL.Parameter("ID", SqlDbType.SmallInt, 0, ParameterDirection.Input, ID),
                    !isUpdateGroup ? null : new MSSQL.Parameter("Group", SqlDbType.VarChar, 0, ParameterDirection.Input, Group),
                    !isUpdateName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    !isUpdateKey ? null : new MSSQL.Parameter("Key", SqlDbType.VarChar, 0, ParameterDirection.Input, Key),
                    !isUpdateValue ? null : new MSSQL.Parameter("Value", SqlDbType.VarChar, 0, ParameterDirection.Input, Value),
                    !isUpdateValueBinary ? null : new MSSQL.Parameter("ValueBinary", SqlDbType.Image, 0, ParameterDirection.Input, ValueBinary),
                    !isUpdateDescription ? null : new MSSQL.Parameter("Description", SqlDbType.VarChar, 0, ParameterDirection.Input, Description),
                    !isUpdateisCanEdit ? null : new MSSQL.Parameter("isCanEdit", SqlDbType.Bit, 0, ParameterDirection.Input, isCanEdit)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_Options]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_Options]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_UserBumpedDetail
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_UserBumpedDetail]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, DateTime DateTime, bool isInsertDateTime, int HasBumped, bool isInsertHasBumped)
            {
                string CommandText = "insert into [T_UserBumpedDetail] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertHasBumped)
                    InsertFieldsList += "[HasBumped], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertHasBumped)
                    InsertValuesList += "@HasBumped, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertHasBumped ? null : new MSSQL.Parameter("HasBumped", SqlDbType.Int, 0, ParameterDirection.Input, HasBumped)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, DateTime DateTime, bool isUpdateDateTime, int HasBumped, bool isUpdateHasBumped)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_UserBumpedDetail] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateHasBumped)
                    UpdateFieldsList += "[HasBumped] = @HasBumped, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateHasBumped ? null : new MSSQL.Parameter("HasBumped", SqlDbType.Int, 0, ParameterDirection.Input, HasBumped)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_UserBumpedDetail]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_UserBumpedDetail]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_Competences
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_Competences]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(short ID, bool isInsertID, string Name, bool isInsertName, string Code, bool isInsertCode, string Description, bool isInsertDescription)
            {
                string CommandText = "insert into [T_Competences] (";
                string InsertFieldsList = "";

                if (isInsertID)
                    InsertFieldsList += "[ID], ";
                if (isInsertName)
                    InsertFieldsList += "[Name], ";
                if (isInsertCode)
                    InsertFieldsList += "[Code], ";
                if (isInsertDescription)
                    InsertFieldsList += "[Description], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertID)
                    InsertValuesList += "@ID, ";
                if (isInsertName)
                    InsertValuesList += "@Name, ";
                if (isInsertCode)
                    InsertValuesList += "@Code, ";
                if (isInsertDescription)
                    InsertValuesList += "@Description, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertID ? null : new MSSQL.Parameter("ID", SqlDbType.SmallInt, 0, ParameterDirection.Input, ID),
                    !isInsertName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    !isInsertCode ? null : new MSSQL.Parameter("Code", SqlDbType.VarChar, 0, ParameterDirection.Input, Code),
                    !isInsertDescription ? null : new MSSQL.Parameter("Description", SqlDbType.VarChar, 0, ParameterDirection.Input, Description)
                    );
            }

            public static int Update(string Condition, short ID, bool isUpdateID, string Name, bool isUpdateName, string Code, bool isUpdateCode, string Description, bool isUpdateDescription)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_Competences] set ";
                string UpdateFieldsList = "";

                if (isUpdateID)
                    UpdateFieldsList += "[ID] = @ID, ";
                if (isUpdateName)
                    UpdateFieldsList += "[Name] = @Name, ";
                if (isUpdateCode)
                    UpdateFieldsList += "[Code] = @Code, ";
                if (isUpdateDescription)
                    UpdateFieldsList += "[Description] = @Description, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateID ? null : new MSSQL.Parameter("ID", SqlDbType.SmallInt, 0, ParameterDirection.Input, ID),
                    !isUpdateName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    !isUpdateCode ? null : new MSSQL.Parameter("Code", SqlDbType.VarChar, 0, ParameterDirection.Input, Code),
                    !isUpdateDescription ? null : new MSSQL.Parameter("Description", SqlDbType.VarChar, 0, ParameterDirection.Input, Description)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_Competences]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_Competences]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_CompetencesOfGroups
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_CompetencesOfGroups]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(short GroupID, bool isInsertGroupID, short CompetenceID, bool isInsertCompetenceID)
            {
                string CommandText = "insert into [T_CompetencesOfGroups] (";
                string InsertFieldsList = "";

                if (isInsertGroupID)
                    InsertFieldsList += "[GroupID], ";
                if (isInsertCompetenceID)
                    InsertFieldsList += "[CompetenceID], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertGroupID)
                    InsertValuesList += "@GroupID, ";
                if (isInsertCompetenceID)
                    InsertValuesList += "@CompetenceID, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertGroupID ? null : new MSSQL.Parameter("GroupID", SqlDbType.SmallInt, 0, ParameterDirection.Input, GroupID),
                    !isInsertCompetenceID ? null : new MSSQL.Parameter("CompetenceID", SqlDbType.SmallInt, 0, ParameterDirection.Input, CompetenceID)
                    );
            }

            public static int Update(string Condition, short GroupID, bool isUpdateGroupID, short CompetenceID, bool isUpdateCompetenceID)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_CompetencesOfGroups] set ";
                string UpdateFieldsList = "";

                if (isUpdateGroupID)
                    UpdateFieldsList += "[GroupID] = @GroupID, ";
                if (isUpdateCompetenceID)
                    UpdateFieldsList += "[CompetenceID] = @CompetenceID, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateGroupID ? null : new MSSQL.Parameter("GroupID", SqlDbType.SmallInt, 0, ParameterDirection.Input, GroupID),
                    !isUpdateCompetenceID ? null : new MSSQL.Parameter("CompetenceID", SqlDbType.SmallInt, 0, ParameterDirection.Input, CompetenceID)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_CompetencesOfGroups]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_CompetencesOfGroups]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_IPAddress
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_IPAddress]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(double IPStart, bool isInsertIPStart, double IPEnd, bool isInsertIPEnd, string Country, bool isInsertCountry, string City, bool isInsertCity)
            {
                string CommandText = "insert into [T_IPAddress] (";
                string InsertFieldsList = "";

                if (isInsertIPStart)
                    InsertFieldsList += "[IPStart], ";
                if (isInsertIPEnd)
                    InsertFieldsList += "[IPEnd], ";
                if (isInsertCountry)
                    InsertFieldsList += "[Country], ";
                if (isInsertCity)
                    InsertFieldsList += "[City], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertIPStart)
                    InsertValuesList += "@IPStart, ";
                if (isInsertIPEnd)
                    InsertValuesList += "@IPEnd, ";
                if (isInsertCountry)
                    InsertValuesList += "@Country, ";
                if (isInsertCity)
                    InsertValuesList += "@City, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertIPStart ? null : new MSSQL.Parameter("IPStart", SqlDbType.Float, 0, ParameterDirection.Input, IPStart),
                    !isInsertIPEnd ? null : new MSSQL.Parameter("IPEnd", SqlDbType.Float, 0, ParameterDirection.Input, IPEnd),
                    !isInsertCountry ? null : new MSSQL.Parameter("Country", SqlDbType.NVarChar, 0, ParameterDirection.Input, Country),
                    !isInsertCity ? null : new MSSQL.Parameter("City", SqlDbType.NVarChar, 0, ParameterDirection.Input, City)
                    );
            }

            public static int Update(string Condition, double IPStart, bool isUpdateIPStart, double IPEnd, bool isUpdateIPEnd, string Country, bool isUpdateCountry, string City, bool isUpdateCity)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_IPAddress] set ";
                string UpdateFieldsList = "";

                if (isUpdateIPStart)
                    UpdateFieldsList += "[IPStart] = @IPStart, ";
                if (isUpdateIPEnd)
                    UpdateFieldsList += "[IPEnd] = @IPEnd, ";
                if (isUpdateCountry)
                    UpdateFieldsList += "[Country] = @Country, ";
                if (isUpdateCity)
                    UpdateFieldsList += "[City] = @City, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateIPStart ? null : new MSSQL.Parameter("IPStart", SqlDbType.Float, 0, ParameterDirection.Input, IPStart),
                    !isUpdateIPEnd ? null : new MSSQL.Parameter("IPEnd", SqlDbType.Float, 0, ParameterDirection.Input, IPEnd),
                    !isUpdateCountry ? null : new MSSQL.Parameter("Country", SqlDbType.NVarChar, 0, ParameterDirection.Input, Country),
                    !isUpdateCity ? null : new MSSQL.Parameter("City", SqlDbType.NVarChar, 0, ParameterDirection.Input, City)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_IPAddress]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_IPAddress]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_CompetencesOfUsers
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_CompetencesOfUsers]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, short CompetenceID, bool isInsertCompetenceID)
            {
                string CommandText = "insert into [T_CompetencesOfUsers] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertCompetenceID)
                    InsertFieldsList += "[CompetenceID], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertCompetenceID)
                    InsertValuesList += "@CompetenceID, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertCompetenceID ? null : new MSSQL.Parameter("CompetenceID", SqlDbType.SmallInt, 0, ParameterDirection.Input, CompetenceID)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, short CompetenceID, bool isUpdateCompetenceID)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_CompetencesOfUsers] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateCompetenceID)
                    UpdateFieldsList += "[CompetenceID] = @CompetenceID, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateCompetenceID ? null : new MSSQL.Parameter("CompetenceID", SqlDbType.SmallInt, 0, ParameterDirection.Input, CompetenceID)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_CompetencesOfUsers]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_CompetencesOfUsers]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_UserGroups
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_UserGroups]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(short ID, bool isInsertID, string Name, bool isInsertName, string Description, bool isInsertDescription)
            {
                string CommandText = "insert into [T_UserGroups] (";
                string InsertFieldsList = "";

                if (isInsertID)
                    InsertFieldsList += "[ID], ";
                if (isInsertName)
                    InsertFieldsList += "[Name], ";
                if (isInsertDescription)
                    InsertFieldsList += "[Description], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertID)
                    InsertValuesList += "@ID, ";
                if (isInsertName)
                    InsertValuesList += "@Name, ";
                if (isInsertDescription)
                    InsertValuesList += "@Description, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertID ? null : new MSSQL.Parameter("ID", SqlDbType.SmallInt, 0, ParameterDirection.Input, ID),
                    !isInsertName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    !isInsertDescription ? null : new MSSQL.Parameter("Description", SqlDbType.VarChar, 0, ParameterDirection.Input, Description)
                    );
            }

            public static int Update(string Condition, short ID, bool isUpdateID, string Name, bool isUpdateName, string Description, bool isUpdateDescription)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_UserGroups] set ";
                string UpdateFieldsList = "";

                if (isUpdateID)
                    UpdateFieldsList += "[ID] = @ID, ";
                if (isUpdateName)
                    UpdateFieldsList += "[Name] = @Name, ";
                if (isUpdateDescription)
                    UpdateFieldsList += "[Description] = @Description, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateID ? null : new MSSQL.Parameter("ID", SqlDbType.SmallInt, 0, ParameterDirection.Input, ID),
                    !isUpdateName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    !isUpdateDescription ? null : new MSSQL.Parameter("Description", SqlDbType.VarChar, 0, ParameterDirection.Input, Description)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_UserGroups]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_UserGroups]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_UserInGroups
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_UserInGroups]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, short GroupID, bool isInsertGroupID)
            {
                string CommandText = "insert into [T_UserInGroups] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertGroupID)
                    InsertFieldsList += "[GroupID], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertGroupID)
                    InsertValuesList += "@GroupID, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertGroupID ? null : new MSSQL.Parameter("GroupID", SqlDbType.SmallInt, 0, ParameterDirection.Input, GroupID)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, short GroupID, bool isUpdateGroupID)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_UserInGroups] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateGroupID)
                    UpdateFieldsList += "[GroupID] = @GroupID, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateGroupID ? null : new MSSQL.Parameter("GroupID", SqlDbType.SmallInt, 0, ParameterDirection.Input, GroupID)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_UserInGroups]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_UserInGroups]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_MessageBoard
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_MessageBoard]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, long ToUserID, bool isInsertToUserID, DateTime DateTime, bool isInsertDateTime, string Title, bool isInsertTitle, byte[] Content, bool isInsertContent, DateTime ReplyDateTime, bool isInsertReplyDateTime, byte[] Reply, bool isInsertReply, string IPAddress, bool isInsertIPAddress, int RightNo, bool isInsertRightNo)
            {
                string CommandText = "insert into [T_MessageBoard] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertToUserID)
                    InsertFieldsList += "[ToUserID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertTitle)
                    InsertFieldsList += "[Title], ";
                if (isInsertContent)
                    InsertFieldsList += "[Content], ";
                if (isInsertReplyDateTime)
                    InsertFieldsList += "[ReplyDateTime], ";
                if (isInsertReply)
                    InsertFieldsList += "[Reply], ";
                if (isInsertIPAddress)
                    InsertFieldsList += "[IPAddress], ";
                if (isInsertRightNo)
                    InsertFieldsList += "[RightNo], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertToUserID)
                    InsertValuesList += "@ToUserID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertTitle)
                    InsertValuesList += "@Title, ";
                if (isInsertContent)
                    InsertValuesList += "@Content, ";
                if (isInsertReplyDateTime)
                    InsertValuesList += "@ReplyDateTime, ";
                if (isInsertReply)
                    InsertValuesList += "@Reply, ";
                if (isInsertIPAddress)
                    InsertValuesList += "@IPAddress, ";
                if (isInsertRightNo)
                    InsertValuesList += "@RightNo, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertToUserID ? null : new MSSQL.Parameter("ToUserID", SqlDbType.BigInt, 0, ParameterDirection.Input, ToUserID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertTitle ? null : new MSSQL.Parameter("Title", SqlDbType.VarChar, 0, ParameterDirection.Input, Title),
                    !isInsertContent ? null : new MSSQL.Parameter("Content", SqlDbType.Image, 0, ParameterDirection.Input, Content),
                    !isInsertReplyDateTime ? null : new MSSQL.Parameter("ReplyDateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, ReplyDateTime),
                    !isInsertReply ? null : new MSSQL.Parameter("Reply", SqlDbType.Image, 0, ParameterDirection.Input, Reply),
                    !isInsertIPAddress ? null : new MSSQL.Parameter("IPAddress", SqlDbType.VarChar, 0, ParameterDirection.Input, IPAddress),
                    !isInsertRightNo ? null : new MSSQL.Parameter("RightNo", SqlDbType.Int, 0, ParameterDirection.Input, RightNo)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, long ToUserID, bool isUpdateToUserID, DateTime DateTime, bool isUpdateDateTime, string Title, bool isUpdateTitle, byte[] Content, bool isUpdateContent, DateTime ReplyDateTime, bool isUpdateReplyDateTime, byte[] Reply, bool isUpdateReply, string IPAddress, bool isUpdateIPAddress, int RightNo, bool isUpdateRightNo)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_MessageBoard] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateToUserID)
                    UpdateFieldsList += "[ToUserID] = @ToUserID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateTitle)
                    UpdateFieldsList += "[Title] = @Title, ";
                if (isUpdateContent)
                    UpdateFieldsList += "[Content] = @Content, ";
                if (isUpdateReplyDateTime)
                    UpdateFieldsList += "[ReplyDateTime] = @ReplyDateTime, ";
                if (isUpdateReply)
                    UpdateFieldsList += "[Reply] = @Reply, ";
                if (isUpdateIPAddress)
                    UpdateFieldsList += "[IPAddress] = @IPAddress, ";
                if (isUpdateRightNo)
                    UpdateFieldsList += "[RightNo] = @RightNo, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateToUserID ? null : new MSSQL.Parameter("ToUserID", SqlDbType.BigInt, 0, ParameterDirection.Input, ToUserID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateTitle ? null : new MSSQL.Parameter("Title", SqlDbType.VarChar, 0, ParameterDirection.Input, Title),
                    !isUpdateContent ? null : new MSSQL.Parameter("Content", SqlDbType.Image, 0, ParameterDirection.Input, Content),
                    !isUpdateReplyDateTime ? null : new MSSQL.Parameter("ReplyDateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, ReplyDateTime),
                    !isUpdateReply ? null : new MSSQL.Parameter("Reply", SqlDbType.Image, 0, ParameterDirection.Input, Reply),
                    !isUpdateIPAddress ? null : new MSSQL.Parameter("IPAddress", SqlDbType.VarChar, 0, ParameterDirection.Input, IPAddress),
                    !isUpdateRightNo ? null : new MSSQL.Parameter("RightNo", SqlDbType.Int, 0, ParameterDirection.Input, RightNo)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_MessageBoard]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_MessageBoard]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_UsersOutOfNet
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_UsersOutOfNet]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, DateTime Datetime, bool isInsertDatetime, long NetID, bool isInsertNetID, double OldEarning, bool isInsertOldEarning, double NewEarning, bool isInsertNewEarning)
            {
                string CommandText = "insert into [T_UsersOutOfNet] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDatetime)
                    InsertFieldsList += "[Datetime], ";
                if (isInsertNetID)
                    InsertFieldsList += "[NetID], ";
                if (isInsertOldEarning)
                    InsertFieldsList += "[OldEarning], ";
                if (isInsertNewEarning)
                    InsertFieldsList += "[NewEarning], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDatetime)
                    InsertValuesList += "@Datetime, ";
                if (isInsertNetID)
                    InsertValuesList += "@NetID, ";
                if (isInsertOldEarning)
                    InsertValuesList += "@OldEarning, ";
                if (isInsertNewEarning)
                    InsertValuesList += "@NewEarning, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDatetime ? null : new MSSQL.Parameter("Datetime", SqlDbType.DateTime, 0, ParameterDirection.Input, Datetime),
                    !isInsertNetID ? null : new MSSQL.Parameter("NetID", SqlDbType.BigInt, 0, ParameterDirection.Input, NetID),
                    !isInsertOldEarning ? null : new MSSQL.Parameter("OldEarning", SqlDbType.Money, 0, ParameterDirection.Input, OldEarning),
                    !isInsertNewEarning ? null : new MSSQL.Parameter("NewEarning", SqlDbType.Money, 0, ParameterDirection.Input, NewEarning)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, DateTime Datetime, bool isUpdateDatetime, long NetID, bool isUpdateNetID, double OldEarning, bool isUpdateOldEarning, double NewEarning, bool isUpdateNewEarning)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_UsersOutOfNet] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDatetime)
                    UpdateFieldsList += "[Datetime] = @Datetime, ";
                if (isUpdateNetID)
                    UpdateFieldsList += "[NetID] = @NetID, ";
                if (isUpdateOldEarning)
                    UpdateFieldsList += "[OldEarning] = @OldEarning, ";
                if (isUpdateNewEarning)
                    UpdateFieldsList += "[NewEarning] = @NewEarning, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDatetime ? null : new MSSQL.Parameter("Datetime", SqlDbType.DateTime, 0, ParameterDirection.Input, Datetime),
                    !isUpdateNetID ? null : new MSSQL.Parameter("NetID", SqlDbType.BigInt, 0, ParameterDirection.Input, NetID),
                    !isUpdateOldEarning ? null : new MSSQL.Parameter("OldEarning", SqlDbType.Money, 0, ParameterDirection.Input, OldEarning),
                    !isUpdateNewEarning ? null : new MSSQL.Parameter("NewEarning", SqlDbType.Money, 0, ParameterDirection.Input, NewEarning)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_UsersOutOfNet]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_UsersOutOfNet]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_News
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_News]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, DateTime DateTime, bool isInsertDateTime, string Title, bool isInsertTitle, byte[] Content, bool isInsertContent, bool isShow, bool isInsertisShow, int Type, bool isInsertType)
            {
                string CommandText = "insert into [T_News] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertTitle)
                    InsertFieldsList += "[Title], ";
                if (isInsertContent)
                    InsertFieldsList += "[Content], ";
                if (isInsertisShow)
                    InsertFieldsList += "[isShow], ";
                if (isInsertType)
                    InsertFieldsList += "[Type], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertTitle)
                    InsertValuesList += "@Title, ";
                if (isInsertContent)
                    InsertValuesList += "@Content, ";
                if (isInsertisShow)
                    InsertValuesList += "@isShow, ";
                if (isInsertType)
                    InsertValuesList += "@Type, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertTitle ? null : new MSSQL.Parameter("Title", SqlDbType.VarChar, 0, ParameterDirection.Input, Title),
                    !isInsertContent ? null : new MSSQL.Parameter("Content", SqlDbType.Image, 0, ParameterDirection.Input, Content),
                    !isInsertisShow ? null : new MSSQL.Parameter("isShow", SqlDbType.Bit, 0, ParameterDirection.Input, isShow),
                    !isInsertType ? null : new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, DateTime DateTime, bool isUpdateDateTime, string Title, bool isUpdateTitle, byte[] Content, bool isUpdateContent, bool isShow, bool isUpdateisShow, int Type, bool isUpdateType)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_News] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateTitle)
                    UpdateFieldsList += "[Title] = @Title, ";
                if (isUpdateContent)
                    UpdateFieldsList += "[Content] = @Content, ";
                if (isUpdateisShow)
                    UpdateFieldsList += "[isShow] = @isShow, ";
                if (isUpdateType)
                    UpdateFieldsList += "[Type] = @Type, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateTitle ? null : new MSSQL.Parameter("Title", SqlDbType.VarChar, 0, ParameterDirection.Input, Title),
                    !isUpdateContent ? null : new MSSQL.Parameter("Content", SqlDbType.Image, 0, ParameterDirection.Input, Content),
                    !isUpdateisShow ? null : new MSSQL.Parameter("isShow", SqlDbType.Bit, 0, ParameterDirection.Input, isShow),
                    !isUpdateType ? null : new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_News]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_News]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_Goods
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_Goods]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(string GoodName, bool isInsertGoodName, double Price, bool isInsertPrice, string GoodNorm, bool isInsertGoodNorm, string GoodUnit, bool isInsertGoodUnit, string GoodColor, bool isInsertGoodColor, string Remark, bool isInsertRemark, string GoodPic, bool isInsertGoodPic, long TypeID, bool isInsertTypeID, string GoodNo, bool isInsertGoodNo, string Password, bool isInsertPassword, int Status, bool isInsertStatus)
            {
                string CommandText = "insert into [T_Goods] (";
                string InsertFieldsList = "";

                if (isInsertGoodName)
                    InsertFieldsList += "[GoodName], ";
                if (isInsertPrice)
                    InsertFieldsList += "[Price], ";
                if (isInsertGoodNorm)
                    InsertFieldsList += "[GoodNorm], ";
                if (isInsertGoodUnit)
                    InsertFieldsList += "[GoodUnit], ";
                if (isInsertGoodColor)
                    InsertFieldsList += "[GoodColor], ";
                if (isInsertRemark)
                    InsertFieldsList += "[Remark], ";
                if (isInsertGoodPic)
                    InsertFieldsList += "[GoodPic], ";
                if (isInsertTypeID)
                    InsertFieldsList += "[TypeID], ";
                if (isInsertGoodNo)
                    InsertFieldsList += "[GoodNo], ";
                if (isInsertPassword)
                    InsertFieldsList += "[Password], ";
                if (isInsertStatus)
                    InsertFieldsList += "[Status], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertGoodName)
                    InsertValuesList += "@GoodName, ";
                if (isInsertPrice)
                    InsertValuesList += "@Price, ";
                if (isInsertGoodNorm)
                    InsertValuesList += "@GoodNorm, ";
                if (isInsertGoodUnit)
                    InsertValuesList += "@GoodUnit, ";
                if (isInsertGoodColor)
                    InsertValuesList += "@GoodColor, ";
                if (isInsertRemark)
                    InsertValuesList += "@Remark, ";
                if (isInsertGoodPic)
                    InsertValuesList += "@GoodPic, ";
                if (isInsertTypeID)
                    InsertValuesList += "@TypeID, ";
                if (isInsertGoodNo)
                    InsertValuesList += "@GoodNo, ";
                if (isInsertPassword)
                    InsertValuesList += "@Password, ";
                if (isInsertStatus)
                    InsertValuesList += "@Status, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertGoodName ? null : new MSSQL.Parameter("GoodName", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodName),
                    !isInsertPrice ? null : new MSSQL.Parameter("Price", SqlDbType.Float, 0, ParameterDirection.Input, Price),
                    !isInsertGoodNorm ? null : new MSSQL.Parameter("GoodNorm", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodNorm),
                    !isInsertGoodUnit ? null : new MSSQL.Parameter("GoodUnit", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodUnit),
                    !isInsertGoodColor ? null : new MSSQL.Parameter("GoodColor", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodColor),
                    !isInsertRemark ? null : new MSSQL.Parameter("Remark", SqlDbType.VarChar, 0, ParameterDirection.Input, Remark),
                    !isInsertGoodPic ? null : new MSSQL.Parameter("GoodPic", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodPic),
                    !isInsertTypeID ? null : new MSSQL.Parameter("TypeID", SqlDbType.BigInt, 0, ParameterDirection.Input, TypeID),
                    !isInsertGoodNo ? null : new MSSQL.Parameter("GoodNo", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodNo),
                    !isInsertPassword ? null : new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password),
                    !isInsertStatus ? null : new MSSQL.Parameter("Status", SqlDbType.Int, 0, ParameterDirection.Input, Status)
                    );
            }

            public static int Update(string Condition, string GoodName, bool isUpdateGoodName, double Price, bool isUpdatePrice, string GoodNorm, bool isUpdateGoodNorm, string GoodUnit, bool isUpdateGoodUnit, string GoodColor, bool isUpdateGoodColor, string Remark, bool isUpdateRemark, string GoodPic, bool isUpdateGoodPic, long TypeID, bool isUpdateTypeID, string GoodNo, bool isUpdateGoodNo, string Password, bool isUpdatePassword, int Status, bool isUpdateStatus)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_Goods] set ";
                string UpdateFieldsList = "";

                if (isUpdateGoodName)
                    UpdateFieldsList += "[GoodName] = @GoodName, ";
                if (isUpdatePrice)
                    UpdateFieldsList += "[Price] = @Price, ";
                if (isUpdateGoodNorm)
                    UpdateFieldsList += "[GoodNorm] = @GoodNorm, ";
                if (isUpdateGoodUnit)
                    UpdateFieldsList += "[GoodUnit] = @GoodUnit, ";
                if (isUpdateGoodColor)
                    UpdateFieldsList += "[GoodColor] = @GoodColor, ";
                if (isUpdateRemark)
                    UpdateFieldsList += "[Remark] = @Remark, ";
                if (isUpdateGoodPic)
                    UpdateFieldsList += "[GoodPic] = @GoodPic, ";
                if (isUpdateTypeID)
                    UpdateFieldsList += "[TypeID] = @TypeID, ";
                if (isUpdateGoodNo)
                    UpdateFieldsList += "[GoodNo] = @GoodNo, ";
                if (isUpdatePassword)
                    UpdateFieldsList += "[Password] = @Password, ";
                if (isUpdateStatus)
                    UpdateFieldsList += "[Status] = @Status, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateGoodName ? null : new MSSQL.Parameter("GoodName", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodName),
                    !isUpdatePrice ? null : new MSSQL.Parameter("Price", SqlDbType.Float, 0, ParameterDirection.Input, Price),
                    !isUpdateGoodNorm ? null : new MSSQL.Parameter("GoodNorm", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodNorm),
                    !isUpdateGoodUnit ? null : new MSSQL.Parameter("GoodUnit", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodUnit),
                    !isUpdateGoodColor ? null : new MSSQL.Parameter("GoodColor", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodColor),
                    !isUpdateRemark ? null : new MSSQL.Parameter("Remark", SqlDbType.VarChar, 0, ParameterDirection.Input, Remark),
                    !isUpdateGoodPic ? null : new MSSQL.Parameter("GoodPic", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodPic),
                    !isUpdateTypeID ? null : new MSSQL.Parameter("TypeID", SqlDbType.BigInt, 0, ParameterDirection.Input, TypeID),
                    !isUpdateGoodNo ? null : new MSSQL.Parameter("GoodNo", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodNo),
                    !isUpdatePassword ? null : new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password),
                    !isUpdateStatus ? null : new MSSQL.Parameter("Status", SqlDbType.Int, 0, ParameterDirection.Input, Status)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_Goods]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_Goods]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_GoodSales
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_GoodSales]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, long GoodID, bool isInsertGoodID, int Amount, bool isInsertAmount, DateTime SalesDate, bool isInsertSalesDate, double Total, bool isInsertTotal, int PayType, bool isInsertPayType, int Status, bool isInsertStatus)
            {
                string CommandText = "insert into [T_GoodSales] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertGoodID)
                    InsertFieldsList += "[GoodID], ";
                if (isInsertAmount)
                    InsertFieldsList += "[Amount], ";
                if (isInsertSalesDate)
                    InsertFieldsList += "[SalesDate], ";
                if (isInsertTotal)
                    InsertFieldsList += "[Total], ";
                if (isInsertPayType)
                    InsertFieldsList += "[PayType], ";
                if (isInsertStatus)
                    InsertFieldsList += "[Status], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertGoodID)
                    InsertValuesList += "@GoodID, ";
                if (isInsertAmount)
                    InsertValuesList += "@Amount, ";
                if (isInsertSalesDate)
                    InsertValuesList += "@SalesDate, ";
                if (isInsertTotal)
                    InsertValuesList += "@Total, ";
                if (isInsertPayType)
                    InsertValuesList += "@PayType, ";
                if (isInsertStatus)
                    InsertValuesList += "@Status, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertGoodID ? null : new MSSQL.Parameter("GoodID", SqlDbType.BigInt, 0, ParameterDirection.Input, GoodID),
                    !isInsertAmount ? null : new MSSQL.Parameter("Amount", SqlDbType.Int, 0, ParameterDirection.Input, Amount),
                    !isInsertSalesDate ? null : new MSSQL.Parameter("SalesDate", SqlDbType.DateTime, 0, ParameterDirection.Input, SalesDate),
                    !isInsertTotal ? null : new MSSQL.Parameter("Total", SqlDbType.Money, 0, ParameterDirection.Input, Total),
                    !isInsertPayType ? null : new MSSQL.Parameter("PayType", SqlDbType.Int, 0, ParameterDirection.Input, PayType),
                    !isInsertStatus ? null : new MSSQL.Parameter("Status", SqlDbType.Int, 0, ParameterDirection.Input, Status)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, long GoodID, bool isUpdateGoodID, int Amount, bool isUpdateAmount, DateTime SalesDate, bool isUpdateSalesDate, double Total, bool isUpdateTotal, int PayType, bool isUpdatePayType, int Status, bool isUpdateStatus)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_GoodSales] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateGoodID)
                    UpdateFieldsList += "[GoodID] = @GoodID, ";
                if (isUpdateAmount)
                    UpdateFieldsList += "[Amount] = @Amount, ";
                if (isUpdateSalesDate)
                    UpdateFieldsList += "[SalesDate] = @SalesDate, ";
                if (isUpdateTotal)
                    UpdateFieldsList += "[Total] = @Total, ";
                if (isUpdatePayType)
                    UpdateFieldsList += "[PayType] = @PayType, ";
                if (isUpdateStatus)
                    UpdateFieldsList += "[Status] = @Status, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateGoodID ? null : new MSSQL.Parameter("GoodID", SqlDbType.BigInt, 0, ParameterDirection.Input, GoodID),
                    !isUpdateAmount ? null : new MSSQL.Parameter("Amount", SqlDbType.Int, 0, ParameterDirection.Input, Amount),
                    !isUpdateSalesDate ? null : new MSSQL.Parameter("SalesDate", SqlDbType.DateTime, 0, ParameterDirection.Input, SalesDate),
                    !isUpdateTotal ? null : new MSSQL.Parameter("Total", SqlDbType.Money, 0, ParameterDirection.Input, Total),
                    !isUpdatePayType ? null : new MSSQL.Parameter("PayType", SqlDbType.Int, 0, ParameterDirection.Input, PayType),
                    !isUpdateStatus ? null : new MSSQL.Parameter("Status", SqlDbType.Int, 0, ParameterDirection.Input, Status)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_GoodSales]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_GoodSales]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_Users
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_Users]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(string Name, bool isInsertName, string RealityName, bool isInsertRealityName, string Password, bool isInsertPassword, string Password2, bool isInsertPassword2, string Sex, bool isInsertSex, string Birthday, bool isInsertBirthday, int CityID, bool isInsertCityID, string IDCardNumber, bool isInsertIDCardNumber, string Address, bool isInsertAddress, string Email, bool isInsertEmail, string QQ, bool isInsertQQ, string Telephone, bool isInsertTelephone, string Mobile, bool isInsertMobile, short BankTypeID, bool isInsertBankTypeID, string BankNameDetail, bool isInsertBankNameDetail, string BankCardNumber, bool isInsertBankCardNumber, DateTime RegisterTime, bool isInsertRegisterTime, DateTime LastLoginTime, bool isInsertLastLoginTime, string LastLoginIP, bool isInsertLastLoginIP, int LoginNum, bool isInsertLoginNum, bool isSurrogate, bool isInsertisSurrogate, int UserType, bool isInsertUserType, double Balance, bool isInsertBalance, double Freeze, bool isInsertFreeze, double Tax, bool isInsertTax, double FundManage, bool isInsertFundManage, int FundManageDistill, bool isInsertFundManageDistill, int FundManageDistillUserSelf, bool isInsertFundManageDistillUserSelf, double Earning, bool isInsertEarning, double EarningBalanced, bool isInsertEarningBalanced, double EarningNets2, bool isInsertEarningNets2, double EarningNets2Balanced, bool isInsertEarningNets2Balanced, double Earning3, bool isInsertEarning3, double Earning3Balanced, bool isInsertEarning3Balanced, long ParentID, bool isInsertParentID, int LR, bool isInsertLR, long CommendID, bool isInsertCommendID, bool isCanLogin, bool isInsertisCanLogin, bool isActivation, bool isInsertisActivation, int ActivationID, bool isInsertActivationID, long SurrogateID, bool isInsertSurrogateID, double Bv, bool isInsertBv, double BvBalanced, bool isInsertBvBalanced, double VirtualMoney, bool isInsertVirtualMoney, double VirtualMoneyBalance, bool isInsertVirtualMoneyBalance, double SalesMoney, bool isInsertSalesMoney, DateTime SalesDay, bool isInsertSalesDay, string BankCardName, bool isInsertBankCardName)
            {
                string CommandText = "insert into [T_Users] (";
                string InsertFieldsList = "";

                if (isInsertName)
                    InsertFieldsList += "[Name], ";
                if (isInsertRealityName)
                    InsertFieldsList += "[RealityName], ";
                if (isInsertPassword)
                    InsertFieldsList += "[Password], ";
                if (isInsertPassword2)
                    InsertFieldsList += "[Password2], ";
                if (isInsertSex)
                    InsertFieldsList += "[Sex], ";
                if (isInsertBirthday)
                    InsertFieldsList += "[Birthday], ";
                if (isInsertCityID)
                    InsertFieldsList += "[CityID], ";
                if (isInsertIDCardNumber)
                    InsertFieldsList += "[IDCardNumber], ";
                if (isInsertAddress)
                    InsertFieldsList += "[Address], ";
                if (isInsertEmail)
                    InsertFieldsList += "[Email], ";
                if (isInsertQQ)
                    InsertFieldsList += "[QQ], ";
                if (isInsertTelephone)
                    InsertFieldsList += "[Telephone], ";
                if (isInsertMobile)
                    InsertFieldsList += "[Mobile], ";
                if (isInsertBankTypeID)
                    InsertFieldsList += "[BankTypeID], ";
                if (isInsertBankNameDetail)
                    InsertFieldsList += "[BankNameDetail], ";
                if (isInsertBankCardNumber)
                    InsertFieldsList += "[BankCardNumber], ";
                if (isInsertRegisterTime)
                    InsertFieldsList += "[RegisterTime], ";
                if (isInsertLastLoginTime)
                    InsertFieldsList += "[LastLoginTime], ";
                if (isInsertLastLoginIP)
                    InsertFieldsList += "[LastLoginIP], ";
                if (isInsertLoginNum)
                    InsertFieldsList += "[LoginNum], ";
                if (isInsertisSurrogate)
                    InsertFieldsList += "[isSurrogate], ";
                if (isInsertUserType)
                    InsertFieldsList += "[UserType], ";
                if (isInsertBalance)
                    InsertFieldsList += "[Balance], ";
                if (isInsertFreeze)
                    InsertFieldsList += "[Freeze], ";
                if (isInsertTax)
                    InsertFieldsList += "[Tax], ";
                if (isInsertFundManage)
                    InsertFieldsList += "[FundManage], ";
                if (isInsertFundManageDistill)
                    InsertFieldsList += "[FundManageDistill], ";
                if (isInsertFundManageDistillUserSelf)
                    InsertFieldsList += "[FundManageDistillUserSelf], ";
                if (isInsertEarning)
                    InsertFieldsList += "[Earning], ";
                if (isInsertEarningBalanced)
                    InsertFieldsList += "[EarningBalanced], ";
                if (isInsertEarningNets2)
                    InsertFieldsList += "[EarningNets2], ";
                if (isInsertEarningNets2Balanced)
                    InsertFieldsList += "[EarningNets2Balanced], ";
                if (isInsertEarning3)
                    InsertFieldsList += "[Earning3], ";
                if (isInsertEarning3Balanced)
                    InsertFieldsList += "[Earning3Balanced], ";
                if (isInsertParentID)
                    InsertFieldsList += "[ParentID], ";
                if (isInsertLR)
                    InsertFieldsList += "[LR], ";
                if (isInsertCommendID)
                    InsertFieldsList += "[CommendID], ";
                if (isInsertisCanLogin)
                    InsertFieldsList += "[isCanLogin], ";
                if (isInsertisActivation)
                    InsertFieldsList += "[isActivation], ";
                if (isInsertActivationID)
                    InsertFieldsList += "[ActivationID], ";
                if (isInsertSurrogateID)
                    InsertFieldsList += "[SurrogateID], ";
                if (isInsertBv)
                    InsertFieldsList += "[Bv], ";
                if (isInsertBvBalanced)
                    InsertFieldsList += "[BvBalanced], ";
                if (isInsertVirtualMoney)
                    InsertFieldsList += "[VirtualMoney], ";
                if (isInsertVirtualMoneyBalance)
                    InsertFieldsList += "[VirtualMoneyBalance], ";
                if (isInsertSalesMoney)
                    InsertFieldsList += "[SalesMoney], ";
                if (isInsertSalesDay)
                    InsertFieldsList += "[SalesDay], ";
                if (isInsertBankCardName)
                    InsertFieldsList += "[BankCardName], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertName)
                    InsertValuesList += "@Name, ";
                if (isInsertRealityName)
                    InsertValuesList += "@RealityName, ";
                if (isInsertPassword)
                    InsertValuesList += "@Password, ";
                if (isInsertPassword2)
                    InsertValuesList += "@Password2, ";
                if (isInsertSex)
                    InsertValuesList += "@Sex, ";
                if (isInsertBirthday)
                    InsertValuesList += "@Birthday, ";
                if (isInsertCityID)
                    InsertValuesList += "@CityID, ";
                if (isInsertIDCardNumber)
                    InsertValuesList += "@IDCardNumber, ";
                if (isInsertAddress)
                    InsertValuesList += "@Address, ";
                if (isInsertEmail)
                    InsertValuesList += "@Email, ";
                if (isInsertQQ)
                    InsertValuesList += "@QQ, ";
                if (isInsertTelephone)
                    InsertValuesList += "@Telephone, ";
                if (isInsertMobile)
                    InsertValuesList += "@Mobile, ";
                if (isInsertBankTypeID)
                    InsertValuesList += "@BankTypeID, ";
                if (isInsertBankNameDetail)
                    InsertValuesList += "@BankNameDetail, ";
                if (isInsertBankCardNumber)
                    InsertValuesList += "@BankCardNumber, ";
                if (isInsertRegisterTime)
                    InsertValuesList += "@RegisterTime, ";
                if (isInsertLastLoginTime)
                    InsertValuesList += "@LastLoginTime, ";
                if (isInsertLastLoginIP)
                    InsertValuesList += "@LastLoginIP, ";
                if (isInsertLoginNum)
                    InsertValuesList += "@LoginNum, ";
                if (isInsertisSurrogate)
                    InsertValuesList += "@isSurrogate, ";
                if (isInsertUserType)
                    InsertValuesList += "@UserType, ";
                if (isInsertBalance)
                    InsertValuesList += "@Balance, ";
                if (isInsertFreeze)
                    InsertValuesList += "@Freeze, ";
                if (isInsertTax)
                    InsertValuesList += "@Tax, ";
                if (isInsertFundManage)
                    InsertValuesList += "@FundManage, ";
                if (isInsertFundManageDistill)
                    InsertValuesList += "@FundManageDistill, ";
                if (isInsertFundManageDistillUserSelf)
                    InsertValuesList += "@FundManageDistillUserSelf, ";
                if (isInsertEarning)
                    InsertValuesList += "@Earning, ";
                if (isInsertEarningBalanced)
                    InsertValuesList += "@EarningBalanced, ";
                if (isInsertEarningNets2)
                    InsertValuesList += "@EarningNets2, ";
                if (isInsertEarningNets2Balanced)
                    InsertValuesList += "@EarningNets2Balanced, ";
                if (isInsertEarning3)
                    InsertValuesList += "@Earning3, ";
                if (isInsertEarning3Balanced)
                    InsertValuesList += "@Earning3Balanced, ";
                if (isInsertParentID)
                    InsertValuesList += "@ParentID, ";
                if (isInsertLR)
                    InsertValuesList += "@LR, ";
                if (isInsertCommendID)
                    InsertValuesList += "@CommendID, ";
                if (isInsertisCanLogin)
                    InsertValuesList += "@isCanLogin, ";
                if (isInsertisActivation)
                    InsertValuesList += "@isActivation, ";
                if (isInsertActivationID)
                    InsertValuesList += "@ActivationID, ";
                if (isInsertSurrogateID)
                    InsertValuesList += "@SurrogateID, ";
                if (isInsertBv)
                    InsertValuesList += "@Bv, ";
                if (isInsertBvBalanced)
                    InsertValuesList += "@BvBalanced, ";
                if (isInsertVirtualMoney)
                    InsertValuesList += "@VirtualMoney, ";
                if (isInsertVirtualMoneyBalance)
                    InsertValuesList += "@VirtualMoneyBalance, ";
                if (isInsertSalesMoney)
                    InsertValuesList += "@SalesMoney, ";
                if (isInsertSalesDay)
                    InsertValuesList += "@SalesDay, ";
                if (isInsertBankCardName)
                    InsertValuesList += "@BankCardName, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    !isInsertRealityName ? null : new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 0, ParameterDirection.Input, RealityName),
                    !isInsertPassword ? null : new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password),
                    !isInsertPassword2 ? null : new MSSQL.Parameter("Password2", SqlDbType.VarChar, 0, ParameterDirection.Input, Password2),
                    !isInsertSex ? null : new MSSQL.Parameter("Sex", SqlDbType.Char, 0, ParameterDirection.Input, Sex),
                    !isInsertBirthday ? null : new MSSQL.Parameter("Birthday", SqlDbType.VarChar, 0, ParameterDirection.Input, Birthday),
                    !isInsertCityID ? null : new MSSQL.Parameter("CityID", SqlDbType.Int, 0, ParameterDirection.Input, CityID),
                    !isInsertIDCardNumber ? null : new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, IDCardNumber),
                    !isInsertAddress ? null : new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address),
                    !isInsertEmail ? null : new MSSQL.Parameter("Email", SqlDbType.VarChar, 0, ParameterDirection.Input, Email),
                    !isInsertQQ ? null : new MSSQL.Parameter("QQ", SqlDbType.VarChar, 0, ParameterDirection.Input, QQ),
                    !isInsertTelephone ? null : new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 0, ParameterDirection.Input, Telephone),
                    !isInsertMobile ? null : new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 0, ParameterDirection.Input, Mobile),
                    !isInsertBankTypeID ? null : new MSSQL.Parameter("BankTypeID", SqlDbType.SmallInt, 0, ParameterDirection.Input, BankTypeID),
                    !isInsertBankNameDetail ? null : new MSSQL.Parameter("BankNameDetail", SqlDbType.VarChar, 0, ParameterDirection.Input, BankNameDetail),
                    !isInsertBankCardNumber ? null : new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    !isInsertRegisterTime ? null : new MSSQL.Parameter("RegisterTime", SqlDbType.DateTime, 0, ParameterDirection.Input, RegisterTime),
                    !isInsertLastLoginTime ? null : new MSSQL.Parameter("LastLoginTime", SqlDbType.DateTime, 0, ParameterDirection.Input, LastLoginTime),
                    !isInsertLastLoginIP ? null : new MSSQL.Parameter("LastLoginIP", SqlDbType.VarChar, 0, ParameterDirection.Input, LastLoginIP),
                    !isInsertLoginNum ? null : new MSSQL.Parameter("LoginNum", SqlDbType.Int, 0, ParameterDirection.Input, LoginNum),
                    !isInsertisSurrogate ? null : new MSSQL.Parameter("isSurrogate", SqlDbType.Bit, 0, ParameterDirection.Input, isSurrogate),
                    !isInsertUserType ? null : new MSSQL.Parameter("UserType", SqlDbType.Int, 0, ParameterDirection.Input, UserType),
                    !isInsertBalance ? null : new MSSQL.Parameter("Balance", SqlDbType.Money, 0, ParameterDirection.Input, Balance),
                    !isInsertFreeze ? null : new MSSQL.Parameter("Freeze", SqlDbType.Money, 0, ParameterDirection.Input, Freeze),
                    !isInsertTax ? null : new MSSQL.Parameter("Tax", SqlDbType.Money, 0, ParameterDirection.Input, Tax),
                    !isInsertFundManage ? null : new MSSQL.Parameter("FundManage", SqlDbType.Money, 0, ParameterDirection.Input, FundManage),
                    !isInsertFundManageDistill ? null : new MSSQL.Parameter("FundManageDistill", SqlDbType.Int, 0, ParameterDirection.Input, FundManageDistill),
                    !isInsertFundManageDistillUserSelf ? null : new MSSQL.Parameter("FundManageDistillUserSelf", SqlDbType.Int, 0, ParameterDirection.Input, FundManageDistillUserSelf),
                    !isInsertEarning ? null : new MSSQL.Parameter("Earning", SqlDbType.Money, 0, ParameterDirection.Input, Earning),
                    !isInsertEarningBalanced ? null : new MSSQL.Parameter("EarningBalanced", SqlDbType.Money, 0, ParameterDirection.Input, EarningBalanced),
                    !isInsertEarningNets2 ? null : new MSSQL.Parameter("EarningNets2", SqlDbType.Money, 0, ParameterDirection.Input, EarningNets2),
                    !isInsertEarningNets2Balanced ? null : new MSSQL.Parameter("EarningNets2Balanced", SqlDbType.Money, 0, ParameterDirection.Input, EarningNets2Balanced),
                    !isInsertEarning3 ? null : new MSSQL.Parameter("Earning3", SqlDbType.Money, 0, ParameterDirection.Input, Earning3),
                    !isInsertEarning3Balanced ? null : new MSSQL.Parameter("Earning3Balanced", SqlDbType.Money, 0, ParameterDirection.Input, Earning3Balanced),
                    !isInsertParentID ? null : new MSSQL.Parameter("ParentID", SqlDbType.BigInt, 0, ParameterDirection.Input, ParentID),
                    !isInsertLR ? null : new MSSQL.Parameter("LR", SqlDbType.Int, 0, ParameterDirection.Input, LR),
                    !isInsertCommendID ? null : new MSSQL.Parameter("CommendID", SqlDbType.BigInt, 0, ParameterDirection.Input, CommendID),
                    !isInsertisCanLogin ? null : new MSSQL.Parameter("isCanLogin", SqlDbType.Bit, 0, ParameterDirection.Input, isCanLogin),
                    !isInsertisActivation ? null : new MSSQL.Parameter("isActivation", SqlDbType.Bit, 0, ParameterDirection.Input, isActivation),
                    !isInsertActivationID ? null : new MSSQL.Parameter("ActivationID", SqlDbType.Int, 0, ParameterDirection.Input, ActivationID),
                    !isInsertSurrogateID ? null : new MSSQL.Parameter("SurrogateID", SqlDbType.BigInt, 0, ParameterDirection.Input, SurrogateID),
                    !isInsertBv ? null : new MSSQL.Parameter("Bv", SqlDbType.Money, 0, ParameterDirection.Input, Bv),
                    !isInsertBvBalanced ? null : new MSSQL.Parameter("BvBalanced", SqlDbType.Money, 0, ParameterDirection.Input, BvBalanced),
                    !isInsertVirtualMoney ? null : new MSSQL.Parameter("VirtualMoney", SqlDbType.Money, 0, ParameterDirection.Input, VirtualMoney),
                    !isInsertVirtualMoneyBalance ? null : new MSSQL.Parameter("VirtualMoneyBalance", SqlDbType.Money, 0, ParameterDirection.Input, VirtualMoneyBalance),
                    !isInsertSalesMoney ? null : new MSSQL.Parameter("SalesMoney", SqlDbType.Money, 0, ParameterDirection.Input, SalesMoney),
                    !isInsertSalesDay ? null : new MSSQL.Parameter("SalesDay", SqlDbType.DateTime, 0, ParameterDirection.Input, SalesDay),
                    !isInsertBankCardName ? null : new MSSQL.Parameter("BankCardName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardName)
                    );
            }

            public static int Update(string Condition, string Name, bool isUpdateName, string RealityName, bool isUpdateRealityName, string Password, bool isUpdatePassword, string Password2, bool isUpdatePassword2, string Sex, bool isUpdateSex, string Birthday, bool isUpdateBirthday, int CityID, bool isUpdateCityID, string IDCardNumber, bool isUpdateIDCardNumber, string Address, bool isUpdateAddress, string Email, bool isUpdateEmail, string QQ, bool isUpdateQQ, string Telephone, bool isUpdateTelephone, string Mobile, bool isUpdateMobile, short BankTypeID, bool isUpdateBankTypeID, string BankNameDetail, bool isUpdateBankNameDetail, string BankCardNumber, bool isUpdateBankCardNumber, DateTime RegisterTime, bool isUpdateRegisterTime, DateTime LastLoginTime, bool isUpdateLastLoginTime, string LastLoginIP, bool isUpdateLastLoginIP, int LoginNum, bool isUpdateLoginNum, bool isSurrogate, bool isUpdateisSurrogate, int UserType, bool isUpdateUserType, double Balance, bool isUpdateBalance, double Freeze, bool isUpdateFreeze, double Tax, bool isUpdateTax, double FundManage, bool isUpdateFundManage, int FundManageDistill, bool isUpdateFundManageDistill, int FundManageDistillUserSelf, bool isUpdateFundManageDistillUserSelf, double Earning, bool isUpdateEarning, double EarningBalanced, bool isUpdateEarningBalanced, double EarningNets2, bool isUpdateEarningNets2, double EarningNets2Balanced, bool isUpdateEarningNets2Balanced, double Earning3, bool isUpdateEarning3, double Earning3Balanced, bool isUpdateEarning3Balanced, long ParentID, bool isUpdateParentID, int LR, bool isUpdateLR, long CommendID, bool isUpdateCommendID, bool isCanLogin, bool isUpdateisCanLogin, bool isActivation, bool isUpdateisActivation, int ActivationID, bool isUpdateActivationID, long SurrogateID, bool isUpdateSurrogateID, double Bv, bool isUpdateBv, double BvBalanced, bool isUpdateBvBalanced, double VirtualMoney, bool isUpdateVirtualMoney, double VirtualMoneyBalance, bool isUpdateVirtualMoneyBalance, double SalesMoney, bool isUpdateSalesMoney, DateTime SalesDay, bool isUpdateSalesDay, string BankCardName, bool isUpdateBankCardName)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_Users] set ";
                string UpdateFieldsList = "";

                if (isUpdateName)
                    UpdateFieldsList += "[Name] = @Name, ";
                if (isUpdateRealityName)
                    UpdateFieldsList += "[RealityName] = @RealityName, ";
                if (isUpdatePassword)
                    UpdateFieldsList += "[Password] = @Password, ";
                if (isUpdatePassword2)
                    UpdateFieldsList += "[Password2] = @Password2, ";
                if (isUpdateSex)
                    UpdateFieldsList += "[Sex] = @Sex, ";
                if (isUpdateBirthday)
                    UpdateFieldsList += "[Birthday] = @Birthday, ";
                if (isUpdateCityID)
                    UpdateFieldsList += "[CityID] = @CityID, ";
                if (isUpdateIDCardNumber)
                    UpdateFieldsList += "[IDCardNumber] = @IDCardNumber, ";
                if (isUpdateAddress)
                    UpdateFieldsList += "[Address] = @Address, ";
                if (isUpdateEmail)
                    UpdateFieldsList += "[Email] = @Email, ";
                if (isUpdateQQ)
                    UpdateFieldsList += "[QQ] = @QQ, ";
                if (isUpdateTelephone)
                    UpdateFieldsList += "[Telephone] = @Telephone, ";
                if (isUpdateMobile)
                    UpdateFieldsList += "[Mobile] = @Mobile, ";
                if (isUpdateBankTypeID)
                    UpdateFieldsList += "[BankTypeID] = @BankTypeID, ";
                if (isUpdateBankNameDetail)
                    UpdateFieldsList += "[BankNameDetail] = @BankNameDetail, ";
                if (isUpdateBankCardNumber)
                    UpdateFieldsList += "[BankCardNumber] = @BankCardNumber, ";
                if (isUpdateRegisterTime)
                    UpdateFieldsList += "[RegisterTime] = @RegisterTime, ";
                if (isUpdateLastLoginTime)
                    UpdateFieldsList += "[LastLoginTime] = @LastLoginTime, ";
                if (isUpdateLastLoginIP)
                    UpdateFieldsList += "[LastLoginIP] = @LastLoginIP, ";
                if (isUpdateLoginNum)
                    UpdateFieldsList += "[LoginNum] = @LoginNum, ";
                if (isUpdateisSurrogate)
                    UpdateFieldsList += "[isSurrogate] = @isSurrogate, ";
                if (isUpdateUserType)
                    UpdateFieldsList += "[UserType] = @UserType, ";
                if (isUpdateBalance)
                    UpdateFieldsList += "[Balance] = @Balance, ";
                if (isUpdateFreeze)
                    UpdateFieldsList += "[Freeze] = @Freeze, ";
                if (isUpdateTax)
                    UpdateFieldsList += "[Tax] = @Tax, ";
                if (isUpdateFundManage)
                    UpdateFieldsList += "[FundManage] = @FundManage, ";
                if (isUpdateFundManageDistill)
                    UpdateFieldsList += "[FundManageDistill] = @FundManageDistill, ";
                if (isUpdateFundManageDistillUserSelf)
                    UpdateFieldsList += "[FundManageDistillUserSelf] = @FundManageDistillUserSelf, ";
                if (isUpdateEarning)
                    UpdateFieldsList += "[Earning] = @Earning, ";
                if (isUpdateEarningBalanced)
                    UpdateFieldsList += "[EarningBalanced] = @EarningBalanced, ";
                if (isUpdateEarningNets2)
                    UpdateFieldsList += "[EarningNets2] = @EarningNets2, ";
                if (isUpdateEarningNets2Balanced)
                    UpdateFieldsList += "[EarningNets2Balanced] = @EarningNets2Balanced, ";
                if (isUpdateEarning3)
                    UpdateFieldsList += "[Earning3] = @Earning3, ";
                if (isUpdateEarning3Balanced)
                    UpdateFieldsList += "[Earning3Balanced] = @Earning3Balanced, ";
                if (isUpdateParentID)
                    UpdateFieldsList += "[ParentID] = @ParentID, ";
                if (isUpdateLR)
                    UpdateFieldsList += "[LR] = @LR, ";
                if (isUpdateCommendID)
                    UpdateFieldsList += "[CommendID] = @CommendID, ";
                if (isUpdateisCanLogin)
                    UpdateFieldsList += "[isCanLogin] = @isCanLogin, ";
                if (isUpdateisActivation)
                    UpdateFieldsList += "[isActivation] = @isActivation, ";
                if (isUpdateActivationID)
                    UpdateFieldsList += "[ActivationID] = @ActivationID, ";
                if (isUpdateSurrogateID)
                    UpdateFieldsList += "[SurrogateID] = @SurrogateID, ";
                if (isUpdateBv)
                    UpdateFieldsList += "[Bv] = @Bv, ";
                if (isUpdateBvBalanced)
                    UpdateFieldsList += "[BvBalanced] = @BvBalanced, ";
                if (isUpdateVirtualMoney)
                    UpdateFieldsList += "[VirtualMoney] = @VirtualMoney, ";
                if (isUpdateVirtualMoneyBalance)
                    UpdateFieldsList += "[VirtualMoneyBalance] = @VirtualMoneyBalance, ";
                if (isUpdateSalesMoney)
                    UpdateFieldsList += "[SalesMoney] = @SalesMoney, ";
                if (isUpdateSalesDay)
                    UpdateFieldsList += "[SalesDay] = @SalesDay, ";
                if (isUpdateBankCardName)
                    UpdateFieldsList += "[BankCardName] = @BankCardName, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    !isUpdateRealityName ? null : new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 0, ParameterDirection.Input, RealityName),
                    !isUpdatePassword ? null : new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password),
                    !isUpdatePassword2 ? null : new MSSQL.Parameter("Password2", SqlDbType.VarChar, 0, ParameterDirection.Input, Password2),
                    !isUpdateSex ? null : new MSSQL.Parameter("Sex", SqlDbType.Char, 0, ParameterDirection.Input, Sex),
                    !isUpdateBirthday ? null : new MSSQL.Parameter("Birthday", SqlDbType.VarChar, 0, ParameterDirection.Input, Birthday),
                    !isUpdateCityID ? null : new MSSQL.Parameter("CityID", SqlDbType.Int, 0, ParameterDirection.Input, CityID),
                    !isUpdateIDCardNumber ? null : new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, IDCardNumber),
                    !isUpdateAddress ? null : new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address),
                    !isUpdateEmail ? null : new MSSQL.Parameter("Email", SqlDbType.VarChar, 0, ParameterDirection.Input, Email),
                    !isUpdateQQ ? null : new MSSQL.Parameter("QQ", SqlDbType.VarChar, 0, ParameterDirection.Input, QQ),
                    !isUpdateTelephone ? null : new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 0, ParameterDirection.Input, Telephone),
                    !isUpdateMobile ? null : new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 0, ParameterDirection.Input, Mobile),
                    !isUpdateBankTypeID ? null : new MSSQL.Parameter("BankTypeID", SqlDbType.SmallInt, 0, ParameterDirection.Input, BankTypeID),
                    !isUpdateBankNameDetail ? null : new MSSQL.Parameter("BankNameDetail", SqlDbType.VarChar, 0, ParameterDirection.Input, BankNameDetail),
                    !isUpdateBankCardNumber ? null : new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    !isUpdateRegisterTime ? null : new MSSQL.Parameter("RegisterTime", SqlDbType.DateTime, 0, ParameterDirection.Input, RegisterTime),
                    !isUpdateLastLoginTime ? null : new MSSQL.Parameter("LastLoginTime", SqlDbType.DateTime, 0, ParameterDirection.Input, LastLoginTime),
                    !isUpdateLastLoginIP ? null : new MSSQL.Parameter("LastLoginIP", SqlDbType.VarChar, 0, ParameterDirection.Input, LastLoginIP),
                    !isUpdateLoginNum ? null : new MSSQL.Parameter("LoginNum", SqlDbType.Int, 0, ParameterDirection.Input, LoginNum),
                    !isUpdateisSurrogate ? null : new MSSQL.Parameter("isSurrogate", SqlDbType.Bit, 0, ParameterDirection.Input, isSurrogate),
                    !isUpdateUserType ? null : new MSSQL.Parameter("UserType", SqlDbType.Int, 0, ParameterDirection.Input, UserType),
                    !isUpdateBalance ? null : new MSSQL.Parameter("Balance", SqlDbType.Money, 0, ParameterDirection.Input, Balance),
                    !isUpdateFreeze ? null : new MSSQL.Parameter("Freeze", SqlDbType.Money, 0, ParameterDirection.Input, Freeze),
                    !isUpdateTax ? null : new MSSQL.Parameter("Tax", SqlDbType.Money, 0, ParameterDirection.Input, Tax),
                    !isUpdateFundManage ? null : new MSSQL.Parameter("FundManage", SqlDbType.Money, 0, ParameterDirection.Input, FundManage),
                    !isUpdateFundManageDistill ? null : new MSSQL.Parameter("FundManageDistill", SqlDbType.Int, 0, ParameterDirection.Input, FundManageDistill),
                    !isUpdateFundManageDistillUserSelf ? null : new MSSQL.Parameter("FundManageDistillUserSelf", SqlDbType.Int, 0, ParameterDirection.Input, FundManageDistillUserSelf),
                    !isUpdateEarning ? null : new MSSQL.Parameter("Earning", SqlDbType.Money, 0, ParameterDirection.Input, Earning),
                    !isUpdateEarningBalanced ? null : new MSSQL.Parameter("EarningBalanced", SqlDbType.Money, 0, ParameterDirection.Input, EarningBalanced),
                    !isUpdateEarningNets2 ? null : new MSSQL.Parameter("EarningNets2", SqlDbType.Money, 0, ParameterDirection.Input, EarningNets2),
                    !isUpdateEarningNets2Balanced ? null : new MSSQL.Parameter("EarningNets2Balanced", SqlDbType.Money, 0, ParameterDirection.Input, EarningNets2Balanced),
                    !isUpdateEarning3 ? null : new MSSQL.Parameter("Earning3", SqlDbType.Money, 0, ParameterDirection.Input, Earning3),
                    !isUpdateEarning3Balanced ? null : new MSSQL.Parameter("Earning3Balanced", SqlDbType.Money, 0, ParameterDirection.Input, Earning3Balanced),
                    !isUpdateParentID ? null : new MSSQL.Parameter("ParentID", SqlDbType.BigInt, 0, ParameterDirection.Input, ParentID),
                    !isUpdateLR ? null : new MSSQL.Parameter("LR", SqlDbType.Int, 0, ParameterDirection.Input, LR),
                    !isUpdateCommendID ? null : new MSSQL.Parameter("CommendID", SqlDbType.BigInt, 0, ParameterDirection.Input, CommendID),
                    !isUpdateisCanLogin ? null : new MSSQL.Parameter("isCanLogin", SqlDbType.Bit, 0, ParameterDirection.Input, isCanLogin),
                    !isUpdateisActivation ? null : new MSSQL.Parameter("isActivation", SqlDbType.Bit, 0, ParameterDirection.Input, isActivation),
                    !isUpdateActivationID ? null : new MSSQL.Parameter("ActivationID", SqlDbType.Int, 0, ParameterDirection.Input, ActivationID),
                    !isUpdateSurrogateID ? null : new MSSQL.Parameter("SurrogateID", SqlDbType.BigInt, 0, ParameterDirection.Input, SurrogateID),
                    !isUpdateBv ? null : new MSSQL.Parameter("Bv", SqlDbType.Money, 0, ParameterDirection.Input, Bv),
                    !isUpdateBvBalanced ? null : new MSSQL.Parameter("BvBalanced", SqlDbType.Money, 0, ParameterDirection.Input, BvBalanced),
                    !isUpdateVirtualMoney ? null : new MSSQL.Parameter("VirtualMoney", SqlDbType.Money, 0, ParameterDirection.Input, VirtualMoney),
                    !isUpdateVirtualMoneyBalance ? null : new MSSQL.Parameter("VirtualMoneyBalance", SqlDbType.Money, 0, ParameterDirection.Input, VirtualMoneyBalance),
                    !isUpdateSalesMoney ? null : new MSSQL.Parameter("SalesMoney", SqlDbType.Money, 0, ParameterDirection.Input, SalesMoney),
                    !isUpdateSalesDay ? null : new MSSQL.Parameter("SalesDay", SqlDbType.DateTime, 0, ParameterDirection.Input, SalesDay),
                    !isUpdateBankCardName ? null : new MSSQL.Parameter("BankCardName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardName)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_Users]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_Users]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_SystemLog
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_SystemLog]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, DateTime DateTime, bool isInsertDateTime, string IPAddress, bool isInsertIPAddress, short Description, bool isInsertDescription)
            {
                string CommandText = "insert into [T_SystemLog] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertIPAddress)
                    InsertFieldsList += "[IPAddress], ";
                if (isInsertDescription)
                    InsertFieldsList += "[Description], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertIPAddress)
                    InsertValuesList += "@IPAddress, ";
                if (isInsertDescription)
                    InsertValuesList += "@Description, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertIPAddress ? null : new MSSQL.Parameter("IPAddress", SqlDbType.VarChar, 0, ParameterDirection.Input, IPAddress),
                    !isInsertDescription ? null : new MSSQL.Parameter("Description", SqlDbType.SmallInt, 0, ParameterDirection.Input, Description)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, DateTime DateTime, bool isUpdateDateTime, string IPAddress, bool isUpdateIPAddress, short Description, bool isUpdateDescription)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_SystemLog] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateIPAddress)
                    UpdateFieldsList += "[IPAddress] = @IPAddress, ";
                if (isUpdateDescription)
                    UpdateFieldsList += "[Description] = @Description, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateIPAddress ? null : new MSSQL.Parameter("IPAddress", SqlDbType.VarChar, 0, ParameterDirection.Input, IPAddress),
                    !isUpdateDescription ? null : new MSSQL.Parameter("Description", SqlDbType.SmallInt, 0, ParameterDirection.Input, Description)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_SystemLog]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_SystemLog]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_ReBuyDetails
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_ReBuyDetails]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, DateTime DateTime, bool isInsertDateTime, int Num, bool isInsertNum)
            {
                string CommandText = "insert into [T_ReBuyDetails] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertNum)
                    InsertFieldsList += "[Num], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertNum)
                    InsertValuesList += "@Num, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertNum ? null : new MSSQL.Parameter("Num", SqlDbType.Int, 0, ParameterDirection.Input, Num)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, DateTime DateTime, bool isUpdateDateTime, int Num, bool isUpdateNum)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_ReBuyDetails] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateNum)
                    UpdateFieldsList += "[Num] = @Num, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateNum ? null : new MSSQL.Parameter("Num", SqlDbType.Int, 0, ParameterDirection.Input, Num)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_ReBuyDetails]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_ReBuyDetails]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_UserDetails
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_UserDetails]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, DateTime DateTime, bool isInsertDateTime, int OperatorType, bool isInsertOperatorType, long NetID, bool isInsertNetID, double Money, bool isInsertMoney, string PayNumber, bool isInsertPayNumber, string Memo, bool isInsertMemo, double DistillFormalitiesFeesScale, bool isInsertDistillFormalitiesFeesScale, long OperatorID, bool isInsertOperatorID, string sign, bool isInsertsign)
            {
                string CommandText = "insert into [T_UserDetails] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertOperatorType)
                    InsertFieldsList += "[OperatorType], ";
                if (isInsertNetID)
                    InsertFieldsList += "[NetID], ";
                if (isInsertMoney)
                    InsertFieldsList += "[Money], ";
                if (isInsertPayNumber)
                    InsertFieldsList += "[PayNumber], ";
                if (isInsertMemo)
                    InsertFieldsList += "[Memo], ";
                if (isInsertDistillFormalitiesFeesScale)
                    InsertFieldsList += "[DistillFormalitiesFeesScale], ";
                if (isInsertOperatorID)
                    InsertFieldsList += "[OperatorID], ";
                if (isInsertsign)
                    InsertFieldsList += "[sign], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertOperatorType)
                    InsertValuesList += "@OperatorType, ";
                if (isInsertNetID)
                    InsertValuesList += "@NetID, ";
                if (isInsertMoney)
                    InsertValuesList += "@Money, ";
                if (isInsertPayNumber)
                    InsertValuesList += "@PayNumber, ";
                if (isInsertMemo)
                    InsertValuesList += "@Memo, ";
                if (isInsertDistillFormalitiesFeesScale)
                    InsertValuesList += "@DistillFormalitiesFeesScale, ";
                if (isInsertOperatorID)
                    InsertValuesList += "@OperatorID, ";
                if (isInsertsign)
                    InsertValuesList += "@sign, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertOperatorType ? null : new MSSQL.Parameter("OperatorType", SqlDbType.Int, 0, ParameterDirection.Input, OperatorType),
                    !isInsertNetID ? null : new MSSQL.Parameter("NetID", SqlDbType.BigInt, 0, ParameterDirection.Input, NetID),
                    !isInsertMoney ? null : new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    !isInsertPayNumber ? null : new MSSQL.Parameter("PayNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, PayNumber),
                    !isInsertMemo ? null : new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    !isInsertDistillFormalitiesFeesScale ? null : new MSSQL.Parameter("DistillFormalitiesFeesScale", SqlDbType.Money, 0, ParameterDirection.Input, DistillFormalitiesFeesScale),
                    !isInsertOperatorID ? null : new MSSQL.Parameter("OperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, OperatorID),
                    !isInsertsign ? null : new MSSQL.Parameter("sign", SqlDbType.VarChar, 0, ParameterDirection.Input, sign)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, DateTime DateTime, bool isUpdateDateTime, int OperatorType, bool isUpdateOperatorType, long NetID, bool isUpdateNetID, double Money, bool isUpdateMoney, string PayNumber, bool isUpdatePayNumber, string Memo, bool isUpdateMemo, double DistillFormalitiesFeesScale, bool isUpdateDistillFormalitiesFeesScale, long OperatorID, bool isUpdateOperatorID, string sign, bool isUpdatesign)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_UserDetails] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateOperatorType)
                    UpdateFieldsList += "[OperatorType] = @OperatorType, ";
                if (isUpdateNetID)
                    UpdateFieldsList += "[NetID] = @NetID, ";
                if (isUpdateMoney)
                    UpdateFieldsList += "[Money] = @Money, ";
                if (isUpdatePayNumber)
                    UpdateFieldsList += "[PayNumber] = @PayNumber, ";
                if (isUpdateMemo)
                    UpdateFieldsList += "[Memo] = @Memo, ";
                if (isUpdateDistillFormalitiesFeesScale)
                    UpdateFieldsList += "[DistillFormalitiesFeesScale] = @DistillFormalitiesFeesScale, ";
                if (isUpdateOperatorID)
                    UpdateFieldsList += "[OperatorID] = @OperatorID, ";
                if (isUpdatesign)
                    UpdateFieldsList += "[sign] = @sign, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateOperatorType ? null : new MSSQL.Parameter("OperatorType", SqlDbType.Int, 0, ParameterDirection.Input, OperatorType),
                    !isUpdateNetID ? null : new MSSQL.Parameter("NetID", SqlDbType.BigInt, 0, ParameterDirection.Input, NetID),
                    !isUpdateMoney ? null : new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    !isUpdatePayNumber ? null : new MSSQL.Parameter("PayNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, PayNumber),
                    !isUpdateMemo ? null : new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    !isUpdateDistillFormalitiesFeesScale ? null : new MSSQL.Parameter("DistillFormalitiesFeesScale", SqlDbType.Money, 0, ParameterDirection.Input, DistillFormalitiesFeesScale),
                    !isUpdateOperatorID ? null : new MSSQL.Parameter("OperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, OperatorID),
                    !isUpdatesign ? null : new MSSQL.Parameter("sign", SqlDbType.VarChar, 0, ParameterDirection.Input, sign)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_UserDetails]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_UserDetails]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_City
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_City]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(int ID, bool isInsertID, string Name, bool isInsertName, int ProvinceID, bool isInsertProvinceID)
            {
                string CommandText = "insert into [T_City] (";
                string InsertFieldsList = "";

                if (isInsertID)
                    InsertFieldsList += "[ID], ";
                if (isInsertName)
                    InsertFieldsList += "[Name], ";
                if (isInsertProvinceID)
                    InsertFieldsList += "[ProvinceID], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertID)
                    InsertValuesList += "@ID, ";
                if (isInsertName)
                    InsertValuesList += "@Name, ";
                if (isInsertProvinceID)
                    InsertValuesList += "@ProvinceID, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertID ? null : new MSSQL.Parameter("ID", SqlDbType.Int, 0, ParameterDirection.Input, ID),
                    !isInsertName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    !isInsertProvinceID ? null : new MSSQL.Parameter("ProvinceID", SqlDbType.Int, 0, ParameterDirection.Input, ProvinceID)
                    );
            }

            public static int Update(string Condition, int ID, bool isUpdateID, string Name, bool isUpdateName, int ProvinceID, bool isUpdateProvinceID)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_City] set ";
                string UpdateFieldsList = "";

                if (isUpdateID)
                    UpdateFieldsList += "[ID] = @ID, ";
                if (isUpdateName)
                    UpdateFieldsList += "[Name] = @Name, ";
                if (isUpdateProvinceID)
                    UpdateFieldsList += "[ProvinceID] = @ProvinceID, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateID ? null : new MSSQL.Parameter("ID", SqlDbType.Int, 0, ParameterDirection.Input, ID),
                    !isUpdateName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    !isUpdateProvinceID ? null : new MSSQL.Parameter("ProvinceID", SqlDbType.Int, 0, ParameterDirection.Input, ProvinceID)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_City]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_City]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_Province
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_Province]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(int ID, bool isInsertID, string Name, bool isInsertName)
            {
                string CommandText = "insert into [T_Province] (";
                string InsertFieldsList = "";

                if (isInsertID)
                    InsertFieldsList += "[ID], ";
                if (isInsertName)
                    InsertFieldsList += "[Name], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertID)
                    InsertValuesList += "@ID, ";
                if (isInsertName)
                    InsertValuesList += "@Name, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertID ? null : new MSSQL.Parameter("ID", SqlDbType.Int, 0, ParameterDirection.Input, ID),
                    !isInsertName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name)
                    );
            }

            public static int Update(string Condition, int ID, bool isUpdateID, string Name, bool isUpdateName)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_Province] set ";
                string UpdateFieldsList = "";

                if (isUpdateID)
                    UpdateFieldsList += "[ID] = @ID, ";
                if (isUpdateName)
                    UpdateFieldsList += "[Name] = @Name, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateID ? null : new MSSQL.Parameter("ID", SqlDbType.Int, 0, ParameterDirection.Input, ID),
                    !isUpdateName ? null : new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_Province]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_Province]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class T_SurplusLog
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [T_SurplusLog]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int Insert(long UserID, bool isInsertUserID, DateTime DateTime, bool isInsertDateTime, long L, bool isInsertL, long R, bool isInsertR, long LDistilled, bool isInsertLDistilled, long RDistilled, bool isInsertRDistilled)
            {
                string CommandText = "insert into [T_SurplusLog] (";
                string InsertFieldsList = "";

                if (isInsertUserID)
                    InsertFieldsList += "[UserID], ";
                if (isInsertDateTime)
                    InsertFieldsList += "[DateTime], ";
                if (isInsertL)
                    InsertFieldsList += "[L], ";
                if (isInsertR)
                    InsertFieldsList += "[R], ";
                if (isInsertLDistilled)
                    InsertFieldsList += "[LDistilled], ";
                if (isInsertRDistilled)
                    InsertFieldsList += "[RDistilled], ";

                if (InsertFieldsList == "")
                    return -101;

                CommandText += InsertFieldsList.Substring(0, InsertFieldsList.Length - 2) + ") values (";
                string InsertValuesList = "";

                if (isInsertUserID)
                    InsertValuesList += "@UserID, ";
                if (isInsertDateTime)
                    InsertValuesList += "@DateTime, ";
                if (isInsertL)
                    InsertValuesList += "@L, ";
                if (isInsertR)
                    InsertValuesList += "@R, ";
                if (isInsertLDistilled)
                    InsertValuesList += "@LDistilled, ";
                if (isInsertRDistilled)
                    InsertValuesList += "@RDistilled, ";

                CommandText += InsertValuesList.Substring(0, InsertValuesList.Length - 2) + ")";

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isInsertUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isInsertDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isInsertL ? null : new MSSQL.Parameter("L", SqlDbType.BigInt, 0, ParameterDirection.Input, L),
                    !isInsertR ? null : new MSSQL.Parameter("R", SqlDbType.BigInt, 0, ParameterDirection.Input, R),
                    !isInsertLDistilled ? null : new MSSQL.Parameter("LDistilled", SqlDbType.BigInt, 0, ParameterDirection.Input, LDistilled),
                    !isInsertRDistilled ? null : new MSSQL.Parameter("RDistilled", SqlDbType.BigInt, 0, ParameterDirection.Input, RDistilled)
                    );
            }

            public static int Update(string Condition, long UserID, bool isUpdateUserID, DateTime DateTime, bool isUpdateDateTime, long L, bool isUpdateL, long R, bool isUpdateR, long LDistilled, bool isUpdateLDistilled, long RDistilled, bool isUpdateRDistilled)
            {
                Condition = Condition.Trim();

                string CommandText = "update [T_SurplusLog] set ";
                string UpdateFieldsList = "";

                if (isUpdateUserID)
                    UpdateFieldsList += "[UserID] = @UserID, ";
                if (isUpdateDateTime)
                    UpdateFieldsList += "[DateTime] = @DateTime, ";
                if (isUpdateL)
                    UpdateFieldsList += "[L] = @L, ";
                if (isUpdateR)
                    UpdateFieldsList += "[R] = @R, ";
                if (isUpdateLDistilled)
                    UpdateFieldsList += "[LDistilled] = @LDistilled, ";
                if (isUpdateRDistilled)
                    UpdateFieldsList += "[RDistilled] = @RDistilled, ";

                if (UpdateFieldsList == "")
                    return -101;

                CommandText += UpdateFieldsList.Substring(0, UpdateFieldsList.Length - 2) + (Condition == "" ? "" : " where " + Condition);

                return MSSQL.ExecuteNonQuery(CommandText,
                    !isUpdateUserID ? null : new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    !isUpdateDateTime ? null : new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime),
                    !isUpdateL ? null : new MSSQL.Parameter("L", SqlDbType.BigInt, 0, ParameterDirection.Input, L),
                    !isUpdateR ? null : new MSSQL.Parameter("R", SqlDbType.BigInt, 0, ParameterDirection.Input, R),
                    !isUpdateLDistilled ? null : new MSSQL.Parameter("LDistilled", SqlDbType.BigInt, 0, ParameterDirection.Input, LDistilled),
                    !isUpdateRDistilled ? null : new MSSQL.Parameter("RDistilled", SqlDbType.BigInt, 0, ParameterDirection.Input, RDistilled)
                    );
            }

            public static int Delete(string Condition)
            {
                Condition = Condition.Trim();

                return MSSQL.ExecuteNonQuery("delete from [T_SurplusLog]" + (Condition == "" ? "" : " where " + Condition));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [T_SurplusLog]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }
    }

    public class Views
    {
        public class V_SalesLimit
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_SalesLimit]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_SalesLimit]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_Shipment
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_Shipment]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_Shipment]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_SurplusLog
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_SurplusLog]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_SurplusLog]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_UserDistills
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_UserDistills]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_UserDistills]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_Users
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_Users]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_Users]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_City
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_City]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_City]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_UserGroups
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_UserGroups]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_UserGroups]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_SystemLog
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_SystemLog]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_SystemLog]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_MessageBoard
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_MessageBoard]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_MessageBoard]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_UsersOutOfNet
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_UsersOutOfNet]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_UsersOutOfNet]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_Nets_2
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_Nets_2]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_Nets_2]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_GoodSales
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_GoodSales]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_GoodSales]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_TryForSurrogate
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_TryForSurrogate]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_TryForSurrogate]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_Goods
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_Goods]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_Goods]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }

        public class V_UserDetails
        {
            public static DataTable Select(string Fields, string Condition, string Sort)
            {
                Fields = Fields.Trim();
                Condition = Condition.Trim();
                Sort = Sort.Trim();

                return MSSQL.Select("select " + (Fields == "" ? "*" : Fields) + " from [V_UserDetails]" + (Condition == "" ? "" : " where " + Condition) + (Sort == "" ? "" : " order by " + Sort));
            }

            public static int GetCount(string Condition)
            {
                Condition = Condition.Trim();

                object Result = MSSQL.ExecuteScalar("select count(*) from [V_UserDetails]" + (Condition == "" ? "" : " where " + Condition));
                if (Result == null)
                    return 0;

                return int.Parse(Result.ToString());
            }
        }
    }

    public class Functions
    {
        public class F_GetUserisInNet
        {
            public static bool Call(long UserID, long NetID)
            {
                object Result = MSSQL.ExecuteFunction("F_GetUserisInNet",
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("NetID", SqlDbType.BigInt, 0, ParameterDirection.Input, NetID)
                    );

                return System.Convert.ToBoolean(Result);
            }
        }

        public class F_GetUserNetScoreSum
        {
            public static long Call(long UserID)
            {
                object Result = MSSQL.ExecuteFunction("F_GetUserNetScoreSum",
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID)
                    );

                return System.Convert.ToInt64(Result);
            }
        }

        public class F_DateTimeToInt
        {
            public static int Call(DateTime dt)
            {
                object Result = MSSQL.ExecuteFunction("F_DateTimeToInt",
                    new MSSQL.Parameter("dt", SqlDbType.DateTime, 0, ParameterDirection.Input, dt)
                    );

                return System.Convert.ToInt32(Result);
            }
        }

        public class F_DateTimeToString
        {
            public static string Call(DateTime Date)
            {
                object Result = MSSQL.ExecuteFunction("F_DateTimeToString",
                    new MSSQL.Parameter("Date", SqlDbType.DateTime, 0, ParameterDirection.Input, Date)
                    );

                return System.Convert.ToString(Result);
            }
        }

        public class F_GetAdministrator
        {
            public static DataTable Open()
            {
                return MSSQL.Select("select * from F_GetAdministrator()"
                    );
            }
        }

        public class F_GetCommendName
        {
            public static string Call(long UserID)
            {
                object Result = MSSQL.ExecuteFunction("F_GetCommendName",
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID)
                    );

                return System.Convert.ToString(Result);
            }
        }

        public class F_GetManagers
        {
            public static DataTable Open()
            {
                return MSSQL.Select("select * from F_GetManagers()"
                    );
            }
        }

        public class F_GetNetCountForUser
        {
            public static int Call(long UserID, int Layer)
            {
                object Result = MSSQL.ExecuteFunction("F_GetNetCountForUser",
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Layer", SqlDbType.Int, 0, ParameterDirection.Input, Layer)
                    );

                return System.Convert.ToInt32(Result);
            }
        }

        public class F_GetOptions
        {
            public static string Call(string Key)
            {
                object Result = MSSQL.ExecuteFunction("F_GetOptions",
                    new MSSQL.Parameter("Key", SqlDbType.VarChar, 0, ParameterDirection.Input, Key)
                    );

                return System.Convert.ToString(Result);
            }
        }

        public class F_GetPlaceFromIPAddress
        {
            public static string Call(string IPAddress)
            {
                object Result = MSSQL.ExecuteFunction("F_GetPlaceFromIPAddress",
                    new MSSQL.Parameter("IPAddress", SqlDbType.VarChar, 0, ParameterDirection.Input, IPAddress)
                    );

                return System.Convert.ToString(Result);
            }
        }

        public class F_GetThisWeek
        {
            public static int Call(DateTime DateTime)
            {
                object Result = MSSQL.ExecuteFunction("F_GetThisWeek",
                    new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime)
                    );

                return System.Convert.ToInt32(Result);
            }
        }

        public class F_GetThisYearMaxWeek
        {
            public static int Call(int Year)
            {
                object Result = MSSQL.ExecuteFunction("F_GetThisYearMaxWeek",
                    new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year)
                    );

                return System.Convert.ToInt32(Result);
            }
        }

        public class F_GetUserCommendCount
        {
            public static int Call(long UserID)
            {
                object Result = MSSQL.ExecuteFunction("F_GetUserCommendCount",
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID)
                    );

                return System.Convert.ToInt32(Result);
            }
        }

        public class F_GetUserCompetencesList
        {
            public static string Call(long UserID)
            {
                object Result = MSSQL.ExecuteFunction("F_GetUserCompetencesList",
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID)
                    );

                return System.Convert.ToString(Result);
            }
        }

        public class F_GetUserIDByName
        {
            public static long Call(string Name)
            {
                object Result = MSSQL.ExecuteFunction("F_GetUserIDByName",
                    new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name)
                    );

                return System.Convert.ToInt64(Result);
            }
        }

        public class F_GetUserInNetIsLayer
        {
            public static int Call(long UserID, long ChildUserID)
            {
                object Result = MSSQL.ExecuteFunction("F_GetUserInNetIsLayer",
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ChildUserID", SqlDbType.BigInt, 0, ParameterDirection.Input, ChildUserID)
                    );

                return System.Convert.ToInt32(Result);
            }
        }

        public class F_GetChildrenOnSameLine
        {
            public static bool Call(long ChildrenID, long UserID, int LR)
            {
                object Result = MSSQL.ExecuteFunction("F_GetChildrenOnSameLine",
                    new MSSQL.Parameter("ChildrenID", SqlDbType.BigInt, 0, ParameterDirection.Input, ChildrenID),
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("LR", SqlDbType.Int, 0, ParameterDirection.Input, LR)
                    );

                return System.Convert.ToBoolean(Result);
            }
        }

        public class F_IPAddressToInt64
        {
            public static long Call(string IPAddress)
            {
                object Result = MSSQL.ExecuteFunction("F_IPAddressToInt64",
                    new MSSQL.Parameter("IPAddress", SqlDbType.VarChar, 0, ParameterDirection.Input, IPAddress)
                    );

                return System.Convert.ToInt64(Result);
            }
        }

        public class F_SplitString
        {
            public static DataTable Open(string SplitString, string Separator)
            {
                return MSSQL.Select("select * from F_SplitString(@SplitString, @Separator)",
                    new MSSQL.Parameter("SplitString", SqlDbType.VarChar, 0, ParameterDirection.Input, SplitString),
                    new MSSQL.Parameter("Separator", SqlDbType.VarChar, 0, ParameterDirection.Input, Separator)
                    );
            }
        }

        public class F_YMDToInt
        {
            public static int Call(int year, int month, int day)
            {
                object Result = MSSQL.ExecuteFunction("F_YMDToInt",
                    new MSSQL.Parameter("year", SqlDbType.Int, 0, ParameterDirection.Input, year),
                    new MSSQL.Parameter("month", SqlDbType.Int, 0, ParameterDirection.Input, month),
                    new MSSQL.Parameter("day", SqlDbType.Int, 0, ParameterDirection.Input, day)
                    );

                return System.Convert.ToInt32(Result);
            }
        }

        public class F_isLastDayOfMonth
        {
            public static bool Call(DateTime dt)
            {
                object Result = MSSQL.ExecuteFunction("F_isLastDayOfMonth",
                    new MSSQL.Parameter("dt", SqlDbType.DateTime, 0, ParameterDirection.Input, dt)
                    );

                return System.Convert.ToBoolean(Result);
            }
        }

        public class F_isLastDayOfWeek
        {
            public static bool Call(DateTime dt, int Week)
            {
                object Result = MSSQL.ExecuteFunction("F_isLastDayOfWeek",
                    new MSSQL.Parameter("dt", SqlDbType.DateTime, 0, ParameterDirection.Input, dt),
                    new MSSQL.Parameter("Week", SqlDbType.Int, 0, ParameterDirection.Input, Week)
                    );

                return System.Convert.ToBoolean(Result);
            }
        }

        public class F_GetFundManage
        {
            public static double Call(long UserID)
            {
                object Result = MSSQL.ExecuteFunction("F_GetFundManage",
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID)
                    );

                return System.Convert.ToDouble(Result);
            }
        }

        public class F_isToMonth
        {
            public static bool Call(DateTime dt1, DateTime dt2)
            {
                object Result = MSSQL.ExecuteFunction("F_isToMonth",
                    new MSSQL.Parameter("dt1", SqlDbType.DateTime, 0, ParameterDirection.Input, dt1),
                    new MSSQL.Parameter("dt2", SqlDbType.DateTime, 0, ParameterDirection.Input, dt2)
                    );

                return System.Convert.ToBoolean(Result);
            }
        }

        public class F_isToday
        {
            public static bool Call(DateTime dt1, DateTime dt2)
            {
                object Result = MSSQL.ExecuteFunction("F_isToday",
                    new MSSQL.Parameter("dt1", SqlDbType.DateTime, 0, ParameterDirection.Input, dt1),
                    new MSSQL.Parameter("dt2", SqlDbType.DateTime, 0, ParameterDirection.Input, dt2)
                    );

                return System.Convert.ToBoolean(Result);
            }
        }

        public class F_isWeek
        {
            public static bool Call(DateTime dt1, DateTime dt2)
            {
                object Result = MSSQL.ExecuteFunction("F_isWeek",
                    new MSSQL.Parameter("dt1", SqlDbType.DateTime, 0, ParameterDirection.Input, dt1),
                    new MSSQL.Parameter("dt2", SqlDbType.DateTime, 0, ParameterDirection.Input, dt2)
                    );

                return System.Convert.ToBoolean(Result);
            }
        }

        public class F_GetUserNet
        {
            public static DataTable Open(long ID)
            {
                return MSSQL.Select("select * from F_GetUserNet(@ID)",
                    new MSSQL.Parameter("ID", SqlDbType.BigInt, 0, ParameterDirection.Input, ID)
                    );
            }
        }

        public class F_GetUserBumpedSum
        {
            public static int Call(long UserID)
            {
                object Result = MSSQL.ExecuteFunction("F_GetUserBumpedSum",
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID)
                    );

                return System.Convert.ToInt32(Result);
            }
        }

        public class F_GetUserBumpedSumForToday
        {
            public static int Call(long UserID, DateTime Datetime)
            {
                object Result = MSSQL.ExecuteFunction("F_GetUserBumpedSumForToday",
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Datetime", SqlDbType.DateTime, 0, ParameterDirection.Input, Datetime)
                    );

                return System.Convert.ToInt32(Result);
            }
        }

        public class F_MGetOptions
        {
            public static string Call(string Key)
            {
                object Result = MSSQL.ExecuteFunction("F_MGetOptions",
                    new MSSQL.Parameter("Key", SqlDbType.VarChar, 0, ParameterDirection.Input, Key)
                    );

                return System.Convert.ToString(Result);
            }
        }

        public class F_GetScoreForUser
        {
            public static int Call(long UserID)
            {
                object Result = MSSQL.ExecuteFunction("F_GetScoreForUser",
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID)
                    );

                return System.Convert.ToInt32(Result);
            }
        }

        public class F_GetNetScoreSumForUser
        {
            public static DataTable Open(long UserID, DateTime DateTime)
            {
                return MSSQL.Select("select * from F_GetNetScoreSumForUser(@UserID, @DateTime)",
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("DateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, DateTime)
                    );
            }
        }
    }

    public class Procedures
    {
        public class P_AddSalesLimit
        {
            public static int Call(string UserName, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_AddSalesLimit", ref Outputs,
                    new MSSQL.Parameter("UserName", SqlDbType.VarChar, 0, ParameterDirection.Input, UserName),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(string UserName, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_AddSalesLimit", ref Outputs,
                    new MSSQL.Parameter("UserName", SqlDbType.VarChar, 0, ParameterDirection.Input, UserName),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_ActivationUser
        {
            public static int Call(long UserID, long ActivationID, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_ActivationUser", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ActivationID", SqlDbType.BigInt, 0, ParameterDirection.Input, ActivationID),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, long ActivationID, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_ActivationUser", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ActivationID", SqlDbType.BigInt, 0, ParameterDirection.Input, ActivationID),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_Buy
        {
            public static int Call(long SurrogateID, string Name, string RealityName, string Password, string Password2, string Sex, string Birthday, int CityID, string IDCardNumber, string Address, string Email, string QQ, string Telephone, string Mobile, short BankTypeID, string BankNameDetail, string BankCardNumber, string BankCardName, int UserType, long ParentID, int LR, long CommendID, bool AutoNext, bool isActivation, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_Buy", ref Outputs,
                    new MSSQL.Parameter("SurrogateID", SqlDbType.BigInt, 0, ParameterDirection.Input, SurrogateID),
                    new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 0, ParameterDirection.Input, RealityName),
                    new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password),
                    new MSSQL.Parameter("Password2", SqlDbType.VarChar, 0, ParameterDirection.Input, Password2),
                    new MSSQL.Parameter("Sex", SqlDbType.Char, 0, ParameterDirection.Input, Sex),
                    new MSSQL.Parameter("Birthday", SqlDbType.VarChar, 0, ParameterDirection.Input, Birthday),
                    new MSSQL.Parameter("CityID", SqlDbType.Int, 0, ParameterDirection.Input, CityID),
                    new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, IDCardNumber),
                    new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address),
                    new MSSQL.Parameter("Email", SqlDbType.VarChar, 0, ParameterDirection.Input, Email),
                    new MSSQL.Parameter("QQ", SqlDbType.VarChar, 0, ParameterDirection.Input, QQ),
                    new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 0, ParameterDirection.Input, Telephone),
                    new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 0, ParameterDirection.Input, Mobile),
                    new MSSQL.Parameter("BankTypeID", SqlDbType.SmallInt, 0, ParameterDirection.Input, BankTypeID),
                    new MSSQL.Parameter("BankNameDetail", SqlDbType.VarChar, 0, ParameterDirection.Input, BankNameDetail),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("BankCardName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardName),
                    new MSSQL.Parameter("UserType", SqlDbType.Int, 0, ParameterDirection.Input, UserType),
                    new MSSQL.Parameter("ParentID", SqlDbType.BigInt, 0, ParameterDirection.Input, ParentID),
                    new MSSQL.Parameter("LR", SqlDbType.Int, 0, ParameterDirection.Input, LR),
                    new MSSQL.Parameter("CommendID", SqlDbType.BigInt, 0, ParameterDirection.Input, CommendID),
                    new MSSQL.Parameter("AutoNext", SqlDbType.Bit, 0, ParameterDirection.Input, AutoNext),
                    new MSSQL.Parameter("isActivation", SqlDbType.Bit, 0, ParameterDirection.Input, isActivation),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long SurrogateID, string Name, string RealityName, string Password, string Password2, string Sex, string Birthday, int CityID, string IDCardNumber, string Address, string Email, string QQ, string Telephone, string Mobile, short BankTypeID, string BankNameDetail, string BankCardNumber, string BankCardName, int UserType, long ParentID, int LR, long CommendID, bool AutoNext, bool isActivation, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_Buy", ref Outputs,
                    new MSSQL.Parameter("SurrogateID", SqlDbType.BigInt, 0, ParameterDirection.Input, SurrogateID),
                    new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 0, ParameterDirection.Input, RealityName),
                    new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password),
                    new MSSQL.Parameter("Password2", SqlDbType.VarChar, 0, ParameterDirection.Input, Password2),
                    new MSSQL.Parameter("Sex", SqlDbType.Char, 0, ParameterDirection.Input, Sex),
                    new MSSQL.Parameter("Birthday", SqlDbType.VarChar, 0, ParameterDirection.Input, Birthday),
                    new MSSQL.Parameter("CityID", SqlDbType.Int, 0, ParameterDirection.Input, CityID),
                    new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, IDCardNumber),
                    new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address),
                    new MSSQL.Parameter("Email", SqlDbType.VarChar, 0, ParameterDirection.Input, Email),
                    new MSSQL.Parameter("QQ", SqlDbType.VarChar, 0, ParameterDirection.Input, QQ),
                    new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 0, ParameterDirection.Input, Telephone),
                    new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 0, ParameterDirection.Input, Mobile),
                    new MSSQL.Parameter("BankTypeID", SqlDbType.SmallInt, 0, ParameterDirection.Input, BankTypeID),
                    new MSSQL.Parameter("BankNameDetail", SqlDbType.VarChar, 0, ParameterDirection.Input, BankNameDetail),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("BankCardName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardName),
                    new MSSQL.Parameter("UserType", SqlDbType.Int, 0, ParameterDirection.Input, UserType),
                    new MSSQL.Parameter("ParentID", SqlDbType.BigInt, 0, ParameterDirection.Input, ParentID),
                    new MSSQL.Parameter("LR", SqlDbType.Int, 0, ParameterDirection.Input, LR),
                    new MSSQL.Parameter("CommendID", SqlDbType.BigInt, 0, ParameterDirection.Input, CommendID),
                    new MSSQL.Parameter("AutoNext", SqlDbType.Bit, 0, ParameterDirection.Input, AutoNext),
                    new MSSQL.Parameter("isActivation", SqlDbType.Bit, 0, ParameterDirection.Input, isActivation),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_BuyForNets_2
        {
            public static int Call(long UserID, bool isOnce, bool isPresent, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_BuyForNets_2", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("isOnce", SqlDbType.Bit, 0, ParameterDirection.Input, isOnce),
                    new MSSQL.Parameter("isPresent", SqlDbType.Bit, 0, ParameterDirection.Input, isPresent),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, bool isOnce, bool isPresent, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_BuyForNets_2", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("isOnce", SqlDbType.Bit, 0, ParameterDirection.Input, isOnce),
                    new MSSQL.Parameter("isPresent", SqlDbType.Bit, 0, ParameterDirection.Input, isPresent),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_BuyForNets_2_All
        {
            public static int Call()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_BuyForNets_2_All", ref Outputs);

                return CallResult;
            }

            public static DataSet Open()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_BuyForNets_2_All", ref Outputs);

                return ds;
            }
        }

        public class P_DeleteUsers
        {
            public static int Call()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_DeleteUsers", ref Outputs);

                return CallResult;
            }

            public static DataSet Open()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_DeleteUsers", ref Outputs);

                return ds;
            }
        }

        public class P_ClearData
        {
            public static int Call()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_ClearData", ref Outputs);

                return CallResult;
            }

            public static DataSet Open()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_ClearData", ref Outputs);

                return ds;
            }
        }

        public class P_DelUser
        {
            public static int Call(long UserId, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_DelUser", ref Outputs,
                    new MSSQL.Parameter("UserId", SqlDbType.BigInt, 0, ParameterDirection.Input, UserId),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserId, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_DelUser", ref Outputs,
                    new MSSQL.Parameter("UserId", SqlDbType.BigInt, 0, ParameterDirection.Input, UserId),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_EditUserNet
        {
            public static int Call(long UserID, long ParentID, int LR, long CommendID, bool AutoNext, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_EditUserNet", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ParentID", SqlDbType.BigInt, 0, ParameterDirection.Input, ParentID),
                    new MSSQL.Parameter("LR", SqlDbType.Int, 0, ParameterDirection.Input, LR),
                    new MSSQL.Parameter("CommendID", SqlDbType.BigInt, 0, ParameterDirection.Input, CommendID),
                    new MSSQL.Parameter("AutoNext", SqlDbType.Bit, 0, ParameterDirection.Input, AutoNext),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, long ParentID, int LR, long CommendID, bool AutoNext, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_EditUserNet", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ParentID", SqlDbType.BigInt, 0, ParameterDirection.Input, ParentID),
                    new MSSQL.Parameter("LR", SqlDbType.Int, 0, ParameterDirection.Input, LR),
                    new MSSQL.Parameter("CommendID", SqlDbType.BigInt, 0, ParameterDirection.Input, CommendID),
                    new MSSQL.Parameter("AutoNext", SqlDbType.Bit, 0, ParameterDirection.Input, AutoNext),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GetAccountBaseInfo
        {
            public static int Call(ref long RegTotal, ref long DayRegCount, ref double TotalGathering, ref double PayTota, ref double DayBuy, ref double HistoryBuy, ref double CurPlayRatio)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetAccountBaseInfo", ref Outputs,
                    new MSSQL.Parameter("RegTotal", SqlDbType.BigInt, 8, ParameterDirection.Output, RegTotal),
                    new MSSQL.Parameter("DayRegCount", SqlDbType.BigInt, 8, ParameterDirection.Output, DayRegCount),
                    new MSSQL.Parameter("TotalGathering", SqlDbType.Money, 8, ParameterDirection.Output, TotalGathering),
                    new MSSQL.Parameter("PayTota", SqlDbType.Money, 8, ParameterDirection.Output, PayTota),
                    new MSSQL.Parameter("DayBuy", SqlDbType.Money, 8, ParameterDirection.Output, DayBuy),
                    new MSSQL.Parameter("HistoryBuy", SqlDbType.Money, 8, ParameterDirection.Output, HistoryBuy),
                    new MSSQL.Parameter("CurPlayRatio", SqlDbType.Float, 8, ParameterDirection.Output, CurPlayRatio)
                    );

                try
                {
                    RegTotal = System.Convert.ToInt64(Outputs["RegTotal"]);
                }
                catch { }

                try
                {
                    DayRegCount = System.Convert.ToInt64(Outputs["DayRegCount"]);
                }
                catch { }

                try
                {
                    TotalGathering = System.Convert.ToDouble(Outputs["TotalGathering"]);
                }
                catch { }

                try
                {
                    PayTota = System.Convert.ToDouble(Outputs["PayTota"]);
                }
                catch { }

                try
                {
                    DayBuy = System.Convert.ToDouble(Outputs["DayBuy"]);
                }
                catch { }

                try
                {
                    HistoryBuy = System.Convert.ToDouble(Outputs["HistoryBuy"]);
                }
                catch { }

                try
                {
                    CurPlayRatio = System.Convert.ToDouble(Outputs["CurPlayRatio"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(ref long RegTotal, ref long DayRegCount, ref double TotalGathering, ref double PayTota, ref double DayBuy, ref double HistoryBuy, ref double CurPlayRatio)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetAccountBaseInfo", ref Outputs,
                    new MSSQL.Parameter("RegTotal", SqlDbType.BigInt, 8, ParameterDirection.Output, RegTotal),
                    new MSSQL.Parameter("DayRegCount", SqlDbType.BigInt, 8, ParameterDirection.Output, DayRegCount),
                    new MSSQL.Parameter("TotalGathering", SqlDbType.Money, 8, ParameterDirection.Output, TotalGathering),
                    new MSSQL.Parameter("PayTota", SqlDbType.Money, 8, ParameterDirection.Output, PayTota),
                    new MSSQL.Parameter("DayBuy", SqlDbType.Money, 8, ParameterDirection.Output, DayBuy),
                    new MSSQL.Parameter("HistoryBuy", SqlDbType.Money, 8, ParameterDirection.Output, HistoryBuy),
                    new MSSQL.Parameter("CurPlayRatio", SqlDbType.Float, 8, ParameterDirection.Output, CurPlayRatio)
                    );

                try
                {
                    RegTotal = System.Convert.ToInt64(Outputs["RegTotal"]);
                }
                catch { }

                try
                {
                    DayRegCount = System.Convert.ToInt64(Outputs["DayRegCount"]);
                }
                catch { }

                try
                {
                    TotalGathering = System.Convert.ToDouble(Outputs["TotalGathering"]);
                }
                catch { }

                try
                {
                    PayTota = System.Convert.ToDouble(Outputs["PayTota"]);
                }
                catch { }

                try
                {
                    DayBuy = System.Convert.ToDouble(Outputs["DayBuy"]);
                }
                catch { }

                try
                {
                    HistoryBuy = System.Convert.ToDouble(Outputs["HistoryBuy"]);
                }
                catch { }

                try
                {
                    CurPlayRatio = System.Convert.ToDouble(Outputs["CurPlayRatio"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GetChildrenCount
        {
            public static int Call(long UserID, long LR, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetChildrenCount", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("LR", SqlDbType.BigInt, 0, ParameterDirection.Input, LR),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, long LR, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetChildrenCount", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("LR", SqlDbType.BigInt, 0, ParameterDirection.Input, LR),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GetFinanceReport1
        {
            public static int Call(int Year, int Month)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetFinanceReport1", ref Outputs,
                    new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year),
                    new MSSQL.Parameter("Month", SqlDbType.Int, 0, ParameterDirection.Input, Month)
                    );

                return CallResult;
            }

            public static DataSet Open(int Year, int Month)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetFinanceReport1", ref Outputs,
                    new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year),
                    new MSSQL.Parameter("Month", SqlDbType.Int, 0, ParameterDirection.Input, Month)
                    );

                return ds;
            }
        }

        public class P_GetManagerLoginInfo
        {
            public static int Call(long UserID, ref long ManagerCount, ref string AferUser, ref string AfterIp, ref DateTime LoginAfterTime, ref string UserIp, ref DateTime UserLoginTime)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetManagerLoginInfo", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ManagerCount", SqlDbType.BigInt, 8, ParameterDirection.Output, ManagerCount),
                    new MSSQL.Parameter("AferUser", SqlDbType.VarChar, 50, ParameterDirection.Output, AferUser),
                    new MSSQL.Parameter("AfterIp", SqlDbType.VarChar, 50, ParameterDirection.Output, AfterIp),
                    new MSSQL.Parameter("LoginAfterTime", SqlDbType.DateTime, 8, ParameterDirection.Output, LoginAfterTime),
                    new MSSQL.Parameter("UserIp", SqlDbType.VarChar, 50, ParameterDirection.Output, UserIp),
                    new MSSQL.Parameter("UserLoginTime", SqlDbType.DateTime, 8, ParameterDirection.Output, UserLoginTime)
                    );

                try
                {
                    ManagerCount = System.Convert.ToInt64(Outputs["ManagerCount"]);
                }
                catch { }

                try
                {
                    AferUser = System.Convert.ToString(Outputs["AferUser"]);
                }
                catch { }

                try
                {
                    AfterIp = System.Convert.ToString(Outputs["AfterIp"]);
                }
                catch { }

                try
                {
                    LoginAfterTime = System.Convert.ToDateTime(Outputs["LoginAfterTime"]);
                }
                catch { }

                try
                {
                    UserIp = System.Convert.ToString(Outputs["UserIp"]);
                }
                catch { }

                try
                {
                    UserLoginTime = System.Convert.ToDateTime(Outputs["UserLoginTime"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, ref long ManagerCount, ref string AferUser, ref string AfterIp, ref DateTime LoginAfterTime, ref string UserIp, ref DateTime UserLoginTime)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetManagerLoginInfo", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ManagerCount", SqlDbType.BigInt, 8, ParameterDirection.Output, ManagerCount),
                    new MSSQL.Parameter("AferUser", SqlDbType.VarChar, 50, ParameterDirection.Output, AferUser),
                    new MSSQL.Parameter("AfterIp", SqlDbType.VarChar, 50, ParameterDirection.Output, AfterIp),
                    new MSSQL.Parameter("LoginAfterTime", SqlDbType.DateTime, 8, ParameterDirection.Output, LoginAfterTime),
                    new MSSQL.Parameter("UserIp", SqlDbType.VarChar, 50, ParameterDirection.Output, UserIp),
                    new MSSQL.Parameter("UserLoginTime", SqlDbType.DateTime, 8, ParameterDirection.Output, UserLoginTime)
                    );

                try
                {
                    ManagerCount = System.Convert.ToInt64(Outputs["ManagerCount"]);
                }
                catch { }

                try
                {
                    AferUser = System.Convert.ToString(Outputs["AferUser"]);
                }
                catch { }

                try
                {
                    AfterIp = System.Convert.ToString(Outputs["AfterIp"]);
                }
                catch { }

                try
                {
                    LoginAfterTime = System.Convert.ToDateTime(Outputs["LoginAfterTime"]);
                }
                catch { }

                try
                {
                    UserIp = System.Convert.ToString(Outputs["UserIp"]);
                }
                catch { }

                try
                {
                    UserLoginTime = System.Convert.ToDateTime(Outputs["UserLoginTime"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GetNet
        {
            public static int Call(long UserID)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetNet", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID)
                    );

                return CallResult;
            }

            public static DataSet Open(long UserID)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetNet", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID)
                    );

                return ds;
            }
        }

        public class P_GetNetForNets_2
        {
            public static int Call(long UserID, long NetID)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetNetForNets_2", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("NetID", SqlDbType.BigInt, 0, ParameterDirection.Input, NetID)
                    );

                return CallResult;
            }

            public static DataSet Open(long UserID, long NetID)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetNetForNets_2", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("NetID", SqlDbType.BigInt, 0, ParameterDirection.Input, NetID)
                    );

                return ds;
            }
        }

        public class P_GetNewPayNumber
        {
            public static int Call(long UserID, string PayType, double Money, double FormalitiesFees, ref long NewPayNumber, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetNewPayNumber", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("PayType", SqlDbType.VarChar, 0, ParameterDirection.Input, PayType),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("FormalitiesFees", SqlDbType.Money, 0, ParameterDirection.Input, FormalitiesFees),
                    new MSSQL.Parameter("NewPayNumber", SqlDbType.BigInt, 8, ParameterDirection.Output, NewPayNumber),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    NewPayNumber = System.Convert.ToInt64(Outputs["NewPayNumber"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, string PayType, double Money, double FormalitiesFees, ref long NewPayNumber, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetNewPayNumber", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("PayType", SqlDbType.VarChar, 0, ParameterDirection.Input, PayType),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("FormalitiesFees", SqlDbType.Money, 0, ParameterDirection.Input, FormalitiesFees),
                    new MSSQL.Parameter("NewPayNumber", SqlDbType.BigInt, 8, ParameterDirection.Output, NewPayNumber),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    NewPayNumber = System.Convert.ToInt64(Outputs["NewPayNumber"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GetOneNodeForUser
        {
            public static int Call(long UserID, int Location, ref long NetID)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetOneNodeForUser", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Location", SqlDbType.Int, 0, ParameterDirection.Input, Location),
                    new MSSQL.Parameter("NetID", SqlDbType.BigInt, 8, ParameterDirection.Output, NetID)
                    );

                try
                {
                    NetID = System.Convert.ToInt64(Outputs["NetID"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, int Location, ref long NetID)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetOneNodeForUser", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Location", SqlDbType.Int, 0, ParameterDirection.Input, Location),
                    new MSSQL.Parameter("NetID", SqlDbType.BigInt, 8, ParameterDirection.Output, NetID)
                    );

                try
                {
                    NetID = System.Convert.ToInt64(Outputs["NetID"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GetOneNodeFromNets2
        {
            public static int Call(ref long NetID, ref int LR)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetOneNodeFromNets2", ref Outputs,
                    new MSSQL.Parameter("NetID", SqlDbType.BigInt, 8, ParameterDirection.Output, NetID),
                    new MSSQL.Parameter("LR", SqlDbType.Int, 4, ParameterDirection.Output, LR)
                    );

                try
                {
                    NetID = System.Convert.ToInt64(Outputs["NetID"]);
                }
                catch { }

                try
                {
                    LR = System.Convert.ToInt32(Outputs["LR"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(ref long NetID, ref int LR)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetOneNodeFromNets2", ref Outputs,
                    new MSSQL.Parameter("NetID", SqlDbType.BigInt, 8, ParameterDirection.Output, NetID),
                    new MSSQL.Parameter("LR", SqlDbType.Int, 4, ParameterDirection.Output, LR)
                    );

                try
                {
                    NetID = System.Convert.ToInt64(Outputs["NetID"]);
                }
                catch { }

                try
                {
                    LR = System.Convert.ToInt32(Outputs["LR"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GetOptions
        {
            public static int Call(ref DateTime Opt_最后结算日期, ref double Opt_半单价格, ref double Opt_每单价格, ref double Opt_3单价格, ref double Opt_5单价格, ref double Opt_10单价格, ref int Opt_1vsX, ref double Opt_半单对碰奖, ref double Opt_1单对碰奖, ref double Opt_3单对碰奖, ref double Opt_5单对碰奖, ref double Opt_10单对碰奖, ref double Opt_半单日封顶, ref double Opt_1单日封顶, ref double Opt_3单日封顶, ref double Opt_5单日封顶, ref double Opt_10单日封顶, ref double Opt_1单第一代辅导奖比例, ref double Opt_3单第一代辅导奖比例, ref double Opt_3单第二代辅导奖比例, ref double Opt_5单第一代辅导奖比例, ref double Opt_5单第二代辅导奖比例, ref double Opt_5单第三代辅导奖比例, ref double Opt_10单第一代辅导奖比例, ref double Opt_10单第二代辅导奖比例, ref double Opt_10单第三代辅导奖比例, ref double Opt_10单第四代辅导奖比例, ref double Opt_10单第五代辅导奖比例, ref double Opt_半单推荐奖比例, ref double Opt_1单推荐奖比例, ref double Opt_3单推荐奖比例, ref double Opt_5单推荐奖比例, ref double Opt_10单推荐奖比例, ref double Opt_区域代理津贴, ref double Opt_重复消费基金提取比例, ref double Opt_税金提取比例, ref double Opt_会员最低提现金额, ref double Opt_网络管理费, ref bool Opt_我的办公室需验证二级密码, ref string Opt_自动结算时间, ref double Opt_提款手续费比例, ref bool Opt_系统暂停, ref string Opt_系统暂停原因, ref bool Opt_系统紧急关闭)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetOptions", ref Outputs,
                    new MSSQL.Parameter("Opt_最后结算日期", SqlDbType.DateTime, 8, ParameterDirection.Output, Opt_最后结算日期),
                    new MSSQL.Parameter("Opt_半单价格", SqlDbType.Money, 8, ParameterDirection.Output, Opt_半单价格),
                    new MSSQL.Parameter("Opt_每单价格", SqlDbType.Money, 8, ParameterDirection.Output, Opt_每单价格),
                    new MSSQL.Parameter("Opt_3单价格", SqlDbType.Money, 8, ParameterDirection.Output, Opt_3单价格),
                    new MSSQL.Parameter("Opt_5单价格", SqlDbType.Money, 8, ParameterDirection.Output, Opt_5单价格),
                    new MSSQL.Parameter("Opt_10单价格", SqlDbType.Money, 8, ParameterDirection.Output, Opt_10单价格),
                    new MSSQL.Parameter("Opt_1vsX", SqlDbType.Int, 4, ParameterDirection.Output, Opt_1vsX),
                    new MSSQL.Parameter("Opt_半单对碰奖", SqlDbType.Money, 8, ParameterDirection.Output, Opt_半单对碰奖),
                    new MSSQL.Parameter("Opt_1单对碰奖", SqlDbType.Money, 8, ParameterDirection.Output, Opt_1单对碰奖),
                    new MSSQL.Parameter("Opt_3单对碰奖", SqlDbType.Money, 8, ParameterDirection.Output, Opt_3单对碰奖),
                    new MSSQL.Parameter("Opt_5单对碰奖", SqlDbType.Money, 8, ParameterDirection.Output, Opt_5单对碰奖),
                    new MSSQL.Parameter("Opt_10单对碰奖", SqlDbType.Money, 8, ParameterDirection.Output, Opt_10单对碰奖),
                    new MSSQL.Parameter("Opt_半单日封顶", SqlDbType.Money, 8, ParameterDirection.Output, Opt_半单日封顶),
                    new MSSQL.Parameter("Opt_1单日封顶", SqlDbType.Money, 8, ParameterDirection.Output, Opt_1单日封顶),
                    new MSSQL.Parameter("Opt_3单日封顶", SqlDbType.Money, 8, ParameterDirection.Output, Opt_3单日封顶),
                    new MSSQL.Parameter("Opt_5单日封顶", SqlDbType.Money, 8, ParameterDirection.Output, Opt_5单日封顶),
                    new MSSQL.Parameter("Opt_10单日封顶", SqlDbType.Money, 8, ParameterDirection.Output, Opt_10单日封顶),
                    new MSSQL.Parameter("Opt_1单第一代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_1单第一代辅导奖比例),
                    new MSSQL.Parameter("Opt_3单第一代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_3单第一代辅导奖比例),
                    new MSSQL.Parameter("Opt_3单第二代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_3单第二代辅导奖比例),
                    new MSSQL.Parameter("Opt_5单第一代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_5单第一代辅导奖比例),
                    new MSSQL.Parameter("Opt_5单第二代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_5单第二代辅导奖比例),
                    new MSSQL.Parameter("Opt_5单第三代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_5单第三代辅导奖比例),
                    new MSSQL.Parameter("Opt_10单第一代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_10单第一代辅导奖比例),
                    new MSSQL.Parameter("Opt_10单第二代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_10单第二代辅导奖比例),
                    new MSSQL.Parameter("Opt_10单第三代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_10单第三代辅导奖比例),
                    new MSSQL.Parameter("Opt_10单第四代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_10单第四代辅导奖比例),
                    new MSSQL.Parameter("Opt_10单第五代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_10单第五代辅导奖比例),
                    new MSSQL.Parameter("Opt_半单推荐奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_半单推荐奖比例),
                    new MSSQL.Parameter("Opt_1单推荐奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_1单推荐奖比例),
                    new MSSQL.Parameter("Opt_3单推荐奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_3单推荐奖比例),
                    new MSSQL.Parameter("Opt_5单推荐奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_5单推荐奖比例),
                    new MSSQL.Parameter("Opt_10单推荐奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_10单推荐奖比例),
                    new MSSQL.Parameter("Opt_区域代理津贴", SqlDbType.Money, 8, ParameterDirection.Output, Opt_区域代理津贴),
                    new MSSQL.Parameter("Opt_重复消费基金提取比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_重复消费基金提取比例),
                    new MSSQL.Parameter("Opt_税金提取比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_税金提取比例),
                    new MSSQL.Parameter("Opt_会员最低提现金额", SqlDbType.Money, 8, ParameterDirection.Output, Opt_会员最低提现金额),
                    new MSSQL.Parameter("Opt_网络管理费", SqlDbType.Money, 8, ParameterDirection.Output, Opt_网络管理费),
                    new MSSQL.Parameter("Opt_我的办公室需验证二级密码", SqlDbType.Bit, 1, ParameterDirection.Output, Opt_我的办公室需验证二级密码),
                    new MSSQL.Parameter("Opt_自动结算时间", SqlDbType.VarChar, 100, ParameterDirection.Output, Opt_自动结算时间),
                    new MSSQL.Parameter("Opt_提款手续费比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_提款手续费比例),
                    new MSSQL.Parameter("Opt_系统暂停", SqlDbType.Bit, 1, ParameterDirection.Output, Opt_系统暂停),
                    new MSSQL.Parameter("Opt_系统暂停原因", SqlDbType.VarChar, 100, ParameterDirection.Output, Opt_系统暂停原因),
                    new MSSQL.Parameter("Opt_系统紧急关闭", SqlDbType.Bit, 1, ParameterDirection.Output, Opt_系统紧急关闭)
                    );

                try
                {
                    Opt_最后结算日期 = System.Convert.ToDateTime(Outputs["Opt_最后结算日期"]);
                }
                catch { }

                try
                {
                    Opt_半单价格 = System.Convert.ToDouble(Outputs["Opt_半单价格"]);
                }
                catch { }

                try
                {
                    Opt_每单价格 = System.Convert.ToDouble(Outputs["Opt_每单价格"]);
                }
                catch { }

                try
                {
                    Opt_3单价格 = System.Convert.ToDouble(Outputs["Opt_3单价格"]);
                }
                catch { }

                try
                {
                    Opt_5单价格 = System.Convert.ToDouble(Outputs["Opt_5单价格"]);
                }
                catch { }

                try
                {
                    Opt_10单价格 = System.Convert.ToDouble(Outputs["Opt_10单价格"]);
                }
                catch { }

                try
                {
                    Opt_1vsX = System.Convert.ToInt32(Outputs["Opt_1vsX"]);
                }
                catch { }

                try
                {
                    Opt_半单对碰奖 = System.Convert.ToDouble(Outputs["Opt_半单对碰奖"]);
                }
                catch { }

                try
                {
                    Opt_1单对碰奖 = System.Convert.ToDouble(Outputs["Opt_1单对碰奖"]);
                }
                catch { }

                try
                {
                    Opt_3单对碰奖 = System.Convert.ToDouble(Outputs["Opt_3单对碰奖"]);
                }
                catch { }

                try
                {
                    Opt_5单对碰奖 = System.Convert.ToDouble(Outputs["Opt_5单对碰奖"]);
                }
                catch { }

                try
                {
                    Opt_10单对碰奖 = System.Convert.ToDouble(Outputs["Opt_10单对碰奖"]);
                }
                catch { }

                try
                {
                    Opt_半单日封顶 = System.Convert.ToDouble(Outputs["Opt_半单日封顶"]);
                }
                catch { }

                try
                {
                    Opt_1单日封顶 = System.Convert.ToDouble(Outputs["Opt_1单日封顶"]);
                }
                catch { }

                try
                {
                    Opt_3单日封顶 = System.Convert.ToDouble(Outputs["Opt_3单日封顶"]);
                }
                catch { }

                try
                {
                    Opt_5单日封顶 = System.Convert.ToDouble(Outputs["Opt_5单日封顶"]);
                }
                catch { }

                try
                {
                    Opt_10单日封顶 = System.Convert.ToDouble(Outputs["Opt_10单日封顶"]);
                }
                catch { }

                try
                {
                    Opt_1单第一代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_1单第一代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_3单第一代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_3单第一代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_3单第二代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_3单第二代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_5单第一代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_5单第一代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_5单第二代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_5单第二代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_5单第三代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_5单第三代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_10单第一代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_10单第一代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_10单第二代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_10单第二代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_10单第三代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_10单第三代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_10单第四代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_10单第四代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_10单第五代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_10单第五代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_半单推荐奖比例 = System.Convert.ToDouble(Outputs["Opt_半单推荐奖比例"]);
                }
                catch { }

                try
                {
                    Opt_1单推荐奖比例 = System.Convert.ToDouble(Outputs["Opt_1单推荐奖比例"]);
                }
                catch { }

                try
                {
                    Opt_3单推荐奖比例 = System.Convert.ToDouble(Outputs["Opt_3单推荐奖比例"]);
                }
                catch { }

                try
                {
                    Opt_5单推荐奖比例 = System.Convert.ToDouble(Outputs["Opt_5单推荐奖比例"]);
                }
                catch { }

                try
                {
                    Opt_10单推荐奖比例 = System.Convert.ToDouble(Outputs["Opt_10单推荐奖比例"]);
                }
                catch { }

                try
                {
                    Opt_区域代理津贴 = System.Convert.ToDouble(Outputs["Opt_区域代理津贴"]);
                }
                catch { }

                try
                {
                    Opt_重复消费基金提取比例 = System.Convert.ToDouble(Outputs["Opt_重复消费基金提取比例"]);
                }
                catch { }

                try
                {
                    Opt_税金提取比例 = System.Convert.ToDouble(Outputs["Opt_税金提取比例"]);
                }
                catch { }

                try
                {
                    Opt_会员最低提现金额 = System.Convert.ToDouble(Outputs["Opt_会员最低提现金额"]);
                }
                catch { }

                try
                {
                    Opt_网络管理费 = System.Convert.ToDouble(Outputs["Opt_网络管理费"]);
                }
                catch { }

                try
                {
                    Opt_我的办公室需验证二级密码 = System.Convert.ToBoolean(Outputs["Opt_我的办公室需验证二级密码"]);
                }
                catch { }

                try
                {
                    Opt_自动结算时间 = System.Convert.ToString(Outputs["Opt_自动结算时间"]);
                }
                catch { }

                try
                {
                    Opt_提款手续费比例 = System.Convert.ToDouble(Outputs["Opt_提款手续费比例"]);
                }
                catch { }

                try
                {
                    Opt_系统暂停 = System.Convert.ToBoolean(Outputs["Opt_系统暂停"]);
                }
                catch { }

                try
                {
                    Opt_系统暂停原因 = System.Convert.ToString(Outputs["Opt_系统暂停原因"]);
                }
                catch { }

                try
                {
                    Opt_系统紧急关闭 = System.Convert.ToBoolean(Outputs["Opt_系统紧急关闭"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(ref DateTime Opt_最后结算日期, ref double Opt_半单价格, ref double Opt_每单价格, ref double Opt_3单价格, ref double Opt_5单价格, ref double Opt_10单价格, ref int Opt_1vsX, ref double Opt_半单对碰奖, ref double Opt_1单对碰奖, ref double Opt_3单对碰奖, ref double Opt_5单对碰奖, ref double Opt_10单对碰奖, ref double Opt_半单日封顶, ref double Opt_1单日封顶, ref double Opt_3单日封顶, ref double Opt_5单日封顶, ref double Opt_10单日封顶, ref double Opt_1单第一代辅导奖比例, ref double Opt_3单第一代辅导奖比例, ref double Opt_3单第二代辅导奖比例, ref double Opt_5单第一代辅导奖比例, ref double Opt_5单第二代辅导奖比例, ref double Opt_5单第三代辅导奖比例, ref double Opt_10单第一代辅导奖比例, ref double Opt_10单第二代辅导奖比例, ref double Opt_10单第三代辅导奖比例, ref double Opt_10单第四代辅导奖比例, ref double Opt_10单第五代辅导奖比例, ref double Opt_半单推荐奖比例, ref double Opt_1单推荐奖比例, ref double Opt_3单推荐奖比例, ref double Opt_5单推荐奖比例, ref double Opt_10单推荐奖比例, ref double Opt_区域代理津贴, ref double Opt_重复消费基金提取比例, ref double Opt_税金提取比例, ref double Opt_会员最低提现金额, ref double Opt_网络管理费, ref bool Opt_我的办公室需验证二级密码, ref string Opt_自动结算时间, ref double Opt_提款手续费比例, ref bool Opt_系统暂停, ref string Opt_系统暂停原因, ref bool Opt_系统紧急关闭)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetOptions", ref Outputs,
                    new MSSQL.Parameter("Opt_最后结算日期", SqlDbType.DateTime, 8, ParameterDirection.Output, Opt_最后结算日期),
                    new MSSQL.Parameter("Opt_半单价格", SqlDbType.Money, 8, ParameterDirection.Output, Opt_半单价格),
                    new MSSQL.Parameter("Opt_每单价格", SqlDbType.Money, 8, ParameterDirection.Output, Opt_每单价格),
                    new MSSQL.Parameter("Opt_3单价格", SqlDbType.Money, 8, ParameterDirection.Output, Opt_3单价格),
                    new MSSQL.Parameter("Opt_5单价格", SqlDbType.Money, 8, ParameterDirection.Output, Opt_5单价格),
                    new MSSQL.Parameter("Opt_10单价格", SqlDbType.Money, 8, ParameterDirection.Output, Opt_10单价格),
                    new MSSQL.Parameter("Opt_1vsX", SqlDbType.Int, 4, ParameterDirection.Output, Opt_1vsX),
                    new MSSQL.Parameter("Opt_半单对碰奖", SqlDbType.Money, 8, ParameterDirection.Output, Opt_半单对碰奖),
                    new MSSQL.Parameter("Opt_1单对碰奖", SqlDbType.Money, 8, ParameterDirection.Output, Opt_1单对碰奖),
                    new MSSQL.Parameter("Opt_3单对碰奖", SqlDbType.Money, 8, ParameterDirection.Output, Opt_3单对碰奖),
                    new MSSQL.Parameter("Opt_5单对碰奖", SqlDbType.Money, 8, ParameterDirection.Output, Opt_5单对碰奖),
                    new MSSQL.Parameter("Opt_10单对碰奖", SqlDbType.Money, 8, ParameterDirection.Output, Opt_10单对碰奖),
                    new MSSQL.Parameter("Opt_半单日封顶", SqlDbType.Money, 8, ParameterDirection.Output, Opt_半单日封顶),
                    new MSSQL.Parameter("Opt_1单日封顶", SqlDbType.Money, 8, ParameterDirection.Output, Opt_1单日封顶),
                    new MSSQL.Parameter("Opt_3单日封顶", SqlDbType.Money, 8, ParameterDirection.Output, Opt_3单日封顶),
                    new MSSQL.Parameter("Opt_5单日封顶", SqlDbType.Money, 8, ParameterDirection.Output, Opt_5单日封顶),
                    new MSSQL.Parameter("Opt_10单日封顶", SqlDbType.Money, 8, ParameterDirection.Output, Opt_10单日封顶),
                    new MSSQL.Parameter("Opt_1单第一代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_1单第一代辅导奖比例),
                    new MSSQL.Parameter("Opt_3单第一代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_3单第一代辅导奖比例),
                    new MSSQL.Parameter("Opt_3单第二代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_3单第二代辅导奖比例),
                    new MSSQL.Parameter("Opt_5单第一代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_5单第一代辅导奖比例),
                    new MSSQL.Parameter("Opt_5单第二代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_5单第二代辅导奖比例),
                    new MSSQL.Parameter("Opt_5单第三代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_5单第三代辅导奖比例),
                    new MSSQL.Parameter("Opt_10单第一代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_10单第一代辅导奖比例),
                    new MSSQL.Parameter("Opt_10单第二代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_10单第二代辅导奖比例),
                    new MSSQL.Parameter("Opt_10单第三代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_10单第三代辅导奖比例),
                    new MSSQL.Parameter("Opt_10单第四代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_10单第四代辅导奖比例),
                    new MSSQL.Parameter("Opt_10单第五代辅导奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_10单第五代辅导奖比例),
                    new MSSQL.Parameter("Opt_半单推荐奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_半单推荐奖比例),
                    new MSSQL.Parameter("Opt_1单推荐奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_1单推荐奖比例),
                    new MSSQL.Parameter("Opt_3单推荐奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_3单推荐奖比例),
                    new MSSQL.Parameter("Opt_5单推荐奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_5单推荐奖比例),
                    new MSSQL.Parameter("Opt_10单推荐奖比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_10单推荐奖比例),
                    new MSSQL.Parameter("Opt_区域代理津贴", SqlDbType.Money, 8, ParameterDirection.Output, Opt_区域代理津贴),
                    new MSSQL.Parameter("Opt_重复消费基金提取比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_重复消费基金提取比例),
                    new MSSQL.Parameter("Opt_税金提取比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_税金提取比例),
                    new MSSQL.Parameter("Opt_会员最低提现金额", SqlDbType.Money, 8, ParameterDirection.Output, Opt_会员最低提现金额),
                    new MSSQL.Parameter("Opt_网络管理费", SqlDbType.Money, 8, ParameterDirection.Output, Opt_网络管理费),
                    new MSSQL.Parameter("Opt_我的办公室需验证二级密码", SqlDbType.Bit, 1, ParameterDirection.Output, Opt_我的办公室需验证二级密码),
                    new MSSQL.Parameter("Opt_自动结算时间", SqlDbType.VarChar, 100, ParameterDirection.Output, Opt_自动结算时间),
                    new MSSQL.Parameter("Opt_提款手续费比例", SqlDbType.Float, 8, ParameterDirection.Output, Opt_提款手续费比例),
                    new MSSQL.Parameter("Opt_系统暂停", SqlDbType.Bit, 1, ParameterDirection.Output, Opt_系统暂停),
                    new MSSQL.Parameter("Opt_系统暂停原因", SqlDbType.VarChar, 100, ParameterDirection.Output, Opt_系统暂停原因),
                    new MSSQL.Parameter("Opt_系统紧急关闭", SqlDbType.Bit, 1, ParameterDirection.Output, Opt_系统紧急关闭)
                    );

                try
                {
                    Opt_最后结算日期 = System.Convert.ToDateTime(Outputs["Opt_最后结算日期"]);
                }
                catch { }

                try
                {
                    Opt_半单价格 = System.Convert.ToDouble(Outputs["Opt_半单价格"]);
                }
                catch { }

                try
                {
                    Opt_每单价格 = System.Convert.ToDouble(Outputs["Opt_每单价格"]);
                }
                catch { }

                try
                {
                    Opt_3单价格 = System.Convert.ToDouble(Outputs["Opt_3单价格"]);
                }
                catch { }

                try
                {
                    Opt_5单价格 = System.Convert.ToDouble(Outputs["Opt_5单价格"]);
                }
                catch { }

                try
                {
                    Opt_10单价格 = System.Convert.ToDouble(Outputs["Opt_10单价格"]);
                }
                catch { }

                try
                {
                    Opt_1vsX = System.Convert.ToInt32(Outputs["Opt_1vsX"]);
                }
                catch { }

                try
                {
                    Opt_半单对碰奖 = System.Convert.ToDouble(Outputs["Opt_半单对碰奖"]);
                }
                catch { }

                try
                {
                    Opt_1单对碰奖 = System.Convert.ToDouble(Outputs["Opt_1单对碰奖"]);
                }
                catch { }

                try
                {
                    Opt_3单对碰奖 = System.Convert.ToDouble(Outputs["Opt_3单对碰奖"]);
                }
                catch { }

                try
                {
                    Opt_5单对碰奖 = System.Convert.ToDouble(Outputs["Opt_5单对碰奖"]);
                }
                catch { }

                try
                {
                    Opt_10单对碰奖 = System.Convert.ToDouble(Outputs["Opt_10单对碰奖"]);
                }
                catch { }

                try
                {
                    Opt_半单日封顶 = System.Convert.ToDouble(Outputs["Opt_半单日封顶"]);
                }
                catch { }

                try
                {
                    Opt_1单日封顶 = System.Convert.ToDouble(Outputs["Opt_1单日封顶"]);
                }
                catch { }

                try
                {
                    Opt_3单日封顶 = System.Convert.ToDouble(Outputs["Opt_3单日封顶"]);
                }
                catch { }

                try
                {
                    Opt_5单日封顶 = System.Convert.ToDouble(Outputs["Opt_5单日封顶"]);
                }
                catch { }

                try
                {
                    Opt_10单日封顶 = System.Convert.ToDouble(Outputs["Opt_10单日封顶"]);
                }
                catch { }

                try
                {
                    Opt_1单第一代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_1单第一代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_3单第一代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_3单第一代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_3单第二代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_3单第二代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_5单第一代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_5单第一代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_5单第二代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_5单第二代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_5单第三代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_5单第三代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_10单第一代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_10单第一代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_10单第二代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_10单第二代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_10单第三代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_10单第三代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_10单第四代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_10单第四代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_10单第五代辅导奖比例 = System.Convert.ToDouble(Outputs["Opt_10单第五代辅导奖比例"]);
                }
                catch { }

                try
                {
                    Opt_半单推荐奖比例 = System.Convert.ToDouble(Outputs["Opt_半单推荐奖比例"]);
                }
                catch { }

                try
                {
                    Opt_1单推荐奖比例 = System.Convert.ToDouble(Outputs["Opt_1单推荐奖比例"]);
                }
                catch { }

                try
                {
                    Opt_3单推荐奖比例 = System.Convert.ToDouble(Outputs["Opt_3单推荐奖比例"]);
                }
                catch { }

                try
                {
                    Opt_5单推荐奖比例 = System.Convert.ToDouble(Outputs["Opt_5单推荐奖比例"]);
                }
                catch { }

                try
                {
                    Opt_10单推荐奖比例 = System.Convert.ToDouble(Outputs["Opt_10单推荐奖比例"]);
                }
                catch { }

                try
                {
                    Opt_区域代理津贴 = System.Convert.ToDouble(Outputs["Opt_区域代理津贴"]);
                }
                catch { }

                try
                {
                    Opt_重复消费基金提取比例 = System.Convert.ToDouble(Outputs["Opt_重复消费基金提取比例"]);
                }
                catch { }

                try
                {
                    Opt_税金提取比例 = System.Convert.ToDouble(Outputs["Opt_税金提取比例"]);
                }
                catch { }

                try
                {
                    Opt_会员最低提现金额 = System.Convert.ToDouble(Outputs["Opt_会员最低提现金额"]);
                }
                catch { }

                try
                {
                    Opt_网络管理费 = System.Convert.ToDouble(Outputs["Opt_网络管理费"]);
                }
                catch { }

                try
                {
                    Opt_我的办公室需验证二级密码 = System.Convert.ToBoolean(Outputs["Opt_我的办公室需验证二级密码"]);
                }
                catch { }

                try
                {
                    Opt_自动结算时间 = System.Convert.ToString(Outputs["Opt_自动结算时间"]);
                }
                catch { }

                try
                {
                    Opt_提款手续费比例 = System.Convert.ToDouble(Outputs["Opt_提款手续费比例"]);
                }
                catch { }

                try
                {
                    Opt_系统暂停 = System.Convert.ToBoolean(Outputs["Opt_系统暂停"]);
                }
                catch { }

                try
                {
                    Opt_系统暂停原因 = System.Convert.ToString(Outputs["Opt_系统暂停原因"]);
                }
                catch { }

                try
                {
                    Opt_系统紧急关闭 = System.Convert.ToBoolean(Outputs["Opt_系统紧急关闭"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GetScore
        {
            public static int Call()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetScore", ref Outputs);

                return CallResult;
            }

            public static DataSet Open()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetScore", ref Outputs);

                return ds;
            }
        }

        public class P_GetScoreForUser
        {
            public static int Call(long UserID, ref double L, ref double R, ref double L_CurrentMonth, ref double R_CurrentMonth, ref double L_CurrentDay, ref double R_CurrentDay, ref double L_Residual, ref double R_Residual)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetScoreForUser", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("L", SqlDbType.Float, 8, ParameterDirection.Output, L),
                    new MSSQL.Parameter("R", SqlDbType.Float, 8, ParameterDirection.Output, R),
                    new MSSQL.Parameter("L_CurrentMonth", SqlDbType.Float, 8, ParameterDirection.Output, L_CurrentMonth),
                    new MSSQL.Parameter("R_CurrentMonth", SqlDbType.Float, 8, ParameterDirection.Output, R_CurrentMonth),
                    new MSSQL.Parameter("L_CurrentDay", SqlDbType.Float, 8, ParameterDirection.Output, L_CurrentDay),
                    new MSSQL.Parameter("R_CurrentDay", SqlDbType.Float, 8, ParameterDirection.Output, R_CurrentDay),
                    new MSSQL.Parameter("L_Residual", SqlDbType.Float, 8, ParameterDirection.Output, L_Residual),
                    new MSSQL.Parameter("R_Residual", SqlDbType.Float, 8, ParameterDirection.Output, R_Residual)
                    );

                try
                {
                    L = System.Convert.ToDouble(Outputs["L"]);
                }
                catch { }

                try
                {
                    R = System.Convert.ToDouble(Outputs["R"]);
                }
                catch { }

                try
                {
                    L_CurrentMonth = System.Convert.ToDouble(Outputs["L_CurrentMonth"]);
                }
                catch { }

                try
                {
                    R_CurrentMonth = System.Convert.ToDouble(Outputs["R_CurrentMonth"]);
                }
                catch { }

                try
                {
                    L_CurrentDay = System.Convert.ToDouble(Outputs["L_CurrentDay"]);
                }
                catch { }

                try
                {
                    R_CurrentDay = System.Convert.ToDouble(Outputs["R_CurrentDay"]);
                }
                catch { }

                try
                {
                    L_Residual = System.Convert.ToDouble(Outputs["L_Residual"]);
                }
                catch { }

                try
                {
                    R_Residual = System.Convert.ToDouble(Outputs["R_Residual"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, ref double L, ref double R, ref double L_CurrentMonth, ref double R_CurrentMonth, ref double L_CurrentDay, ref double R_CurrentDay, ref double L_Residual, ref double R_Residual)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetScoreForUser", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("L", SqlDbType.Float, 8, ParameterDirection.Output, L),
                    new MSSQL.Parameter("R", SqlDbType.Float, 8, ParameterDirection.Output, R),
                    new MSSQL.Parameter("L_CurrentMonth", SqlDbType.Float, 8, ParameterDirection.Output, L_CurrentMonth),
                    new MSSQL.Parameter("R_CurrentMonth", SqlDbType.Float, 8, ParameterDirection.Output, R_CurrentMonth),
                    new MSSQL.Parameter("L_CurrentDay", SqlDbType.Float, 8, ParameterDirection.Output, L_CurrentDay),
                    new MSSQL.Parameter("R_CurrentDay", SqlDbType.Float, 8, ParameterDirection.Output, R_CurrentDay),
                    new MSSQL.Parameter("L_Residual", SqlDbType.Float, 8, ParameterDirection.Output, L_Residual),
                    new MSSQL.Parameter("R_Residual", SqlDbType.Float, 8, ParameterDirection.Output, R_Residual)
                    );

                try
                {
                    L = System.Convert.ToDouble(Outputs["L"]);
                }
                catch { }

                try
                {
                    R = System.Convert.ToDouble(Outputs["R"]);
                }
                catch { }

                try
                {
                    L_CurrentMonth = System.Convert.ToDouble(Outputs["L_CurrentMonth"]);
                }
                catch { }

                try
                {
                    R_CurrentMonth = System.Convert.ToDouble(Outputs["R_CurrentMonth"]);
                }
                catch { }

                try
                {
                    L_CurrentDay = System.Convert.ToDouble(Outputs["L_CurrentDay"]);
                }
                catch { }

                try
                {
                    R_CurrentDay = System.Convert.ToDouble(Outputs["R_CurrentDay"]);
                }
                catch { }

                try
                {
                    L_Residual = System.Convert.ToDouble(Outputs["L_Residual"]);
                }
                catch { }

                try
                {
                    R_Residual = System.Convert.ToDouble(Outputs["R_Residual"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GetUserAccountDetail
        {
            public static int Call(long UserID, int Year, int Month)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetUserAccountDetail", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year),
                    new MSSQL.Parameter("Month", SqlDbType.Int, 0, ParameterDirection.Input, Month)
                    );

                return CallResult;
            }

            public static DataSet Open(long UserID, int Year, int Month)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetUserAccountDetail", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year),
                    new MSSQL.Parameter("Month", SqlDbType.Int, 0, ParameterDirection.Input, Month)
                    );

                return ds;
            }
        }

        public class P_GetUserAccountDetail2
        {
            public static int Call(long UserID, int Year, int Month)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetUserAccountDetail2", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year),
                    new MSSQL.Parameter("Month", SqlDbType.Int, 0, ParameterDirection.Input, Month)
                    );

                return CallResult;
            }

            public static DataSet Open(long UserID, int Year, int Month)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetUserAccountDetail2", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year),
                    new MSSQL.Parameter("Month", SqlDbType.Int, 0, ParameterDirection.Input, Month)
                    );

                return ds;
            }
        }

        public class P_InComingOrOutComing
        {
            public static int Call(DateTime StartDateTime, DateTime EndDateTime, int Type, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_InComingOrOutComing", ref Outputs,
                    new MSSQL.Parameter("StartDateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, StartDateTime),
                    new MSSQL.Parameter("EndDateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, EndDateTime),
                    new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(DateTime StartDateTime, DateTime EndDateTime, int Type, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_InComingOrOutComing", ref Outputs,
                    new MSSQL.Parameter("StartDateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, StartDateTime),
                    new MSSQL.Parameter("EndDateTime", SqlDbType.DateTime, 0, ParameterDirection.Input, EndDateTime),
                    new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_Login
        {
            public static int Call(string Name, string LoginIP, string InputPassword, ref long UserID, ref string RealityName, ref string Password2, ref string Sex, ref string Birthday, ref int CityID, ref string IDCardNumber, ref string Address, ref string Email, ref string QQ, ref string Telephone, ref string Mobile, ref short BankTypeID, ref string BankNameDetail, ref string BankCardNumber, ref string BankCardName, ref DateTime RegisterTime, ref DateTime LastLoginTime, ref string LastLoginIP, ref int LoginNum, ref bool isSurrogate, ref int UserType, ref double Balance, ref double Freeze, ref double Tax, ref double FundManage, ref int FundManageDistill, ref int FundManageDistillUserSelf, ref double Earning, ref double EarningBalanced, ref double EarningNets2, ref double EarningNets2Balanced, ref double Earning3, ref double Earning3Balanced, ref long ParentID, ref int LR, ref long CommendID, ref bool isCanLogin, ref string BankTypeName, ref string City, ref string Province, ref bool isActivation, ref long SurrogateID, ref double BV, ref double BVBalanced, ref double VirtualMoney, ref double VirtualMoneyBalance, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_Login", ref Outputs,
                    new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    new MSSQL.Parameter("LoginIP", SqlDbType.VarChar, 0, ParameterDirection.Input, LoginIP),
                    new MSSQL.Parameter("InputPassword", SqlDbType.VarChar, 0, ParameterDirection.Input, InputPassword),
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 8, ParameterDirection.Output, UserID),
                    new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 50, ParameterDirection.Output, RealityName),
                    new MSSQL.Parameter("Password2", SqlDbType.VarChar, 1000, ParameterDirection.Output, Password2),
                    new MSSQL.Parameter("Sex", SqlDbType.Char, 2, ParameterDirection.Output, Sex),
                    new MSSQL.Parameter("Birthday", SqlDbType.VarChar, 20, ParameterDirection.Output, Birthday),
                    new MSSQL.Parameter("CityID", SqlDbType.Int, 4, ParameterDirection.Output, CityID),
                    new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 50, ParameterDirection.Output, IDCardNumber),
                    new MSSQL.Parameter("Address", SqlDbType.VarChar, 50, ParameterDirection.Output, Address),
                    new MSSQL.Parameter("Email", SqlDbType.VarChar, 50, ParameterDirection.Output, Email),
                    new MSSQL.Parameter("QQ", SqlDbType.VarChar, 50, ParameterDirection.Output, QQ),
                    new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 50, ParameterDirection.Output, Telephone),
                    new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 50, ParameterDirection.Output, Mobile),
                    new MSSQL.Parameter("BankTypeID", SqlDbType.SmallInt, 2, ParameterDirection.Output, BankTypeID),
                    new MSSQL.Parameter("BankNameDetail", SqlDbType.VarChar, 50, ParameterDirection.Output, BankNameDetail),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 50, ParameterDirection.Output, BankCardNumber),
                    new MSSQL.Parameter("BankCardName", SqlDbType.VarChar, 50, ParameterDirection.Output, BankCardName),
                    new MSSQL.Parameter("RegisterTime", SqlDbType.DateTime, 8, ParameterDirection.Output, RegisterTime),
                    new MSSQL.Parameter("LastLoginTime", SqlDbType.DateTime, 8, ParameterDirection.Output, LastLoginTime),
                    new MSSQL.Parameter("LastLoginIP", SqlDbType.VarChar, 50, ParameterDirection.Output, LastLoginIP),
                    new MSSQL.Parameter("LoginNum", SqlDbType.Int, 4, ParameterDirection.Output, LoginNum),
                    new MSSQL.Parameter("isSurrogate", SqlDbType.Bit, 1, ParameterDirection.Output, isSurrogate),
                    new MSSQL.Parameter("UserType", SqlDbType.Int, 4, ParameterDirection.Output, UserType),
                    new MSSQL.Parameter("Balance", SqlDbType.Money, 8, ParameterDirection.Output, Balance),
                    new MSSQL.Parameter("Freeze", SqlDbType.Money, 8, ParameterDirection.Output, Freeze),
                    new MSSQL.Parameter("Tax", SqlDbType.Money, 8, ParameterDirection.Output, Tax),
                    new MSSQL.Parameter("FundManage", SqlDbType.Money, 8, ParameterDirection.Output, FundManage),
                    new MSSQL.Parameter("FundManageDistill", SqlDbType.Int, 4, ParameterDirection.Output, FundManageDistill),
                    new MSSQL.Parameter("FundManageDistillUserSelf", SqlDbType.Int, 4, ParameterDirection.Output, FundManageDistillUserSelf),
                    new MSSQL.Parameter("Earning", SqlDbType.Money, 8, ParameterDirection.Output, Earning),
                    new MSSQL.Parameter("EarningBalanced", SqlDbType.Money, 8, ParameterDirection.Output, EarningBalanced),
                    new MSSQL.Parameter("EarningNets2", SqlDbType.Money, 8, ParameterDirection.Output, EarningNets2),
                    new MSSQL.Parameter("EarningNets2Balanced", SqlDbType.Money, 8, ParameterDirection.Output, EarningNets2Balanced),
                    new MSSQL.Parameter("Earning3", SqlDbType.Money, 8, ParameterDirection.Output, Earning3),
                    new MSSQL.Parameter("Earning3Balanced", SqlDbType.Money, 8, ParameterDirection.Output, Earning3Balanced),
                    new MSSQL.Parameter("ParentID", SqlDbType.BigInt, 8, ParameterDirection.Output, ParentID),
                    new MSSQL.Parameter("LR", SqlDbType.Int, 4, ParameterDirection.Output, LR),
                    new MSSQL.Parameter("CommendID", SqlDbType.BigInt, 8, ParameterDirection.Output, CommendID),
                    new MSSQL.Parameter("isCanLogin", SqlDbType.Bit, 1, ParameterDirection.Output, isCanLogin),
                    new MSSQL.Parameter("BankTypeName", SqlDbType.VarChar, 50, ParameterDirection.Output, BankTypeName),
                    new MSSQL.Parameter("City", SqlDbType.VarChar, 50, ParameterDirection.Output, City),
                    new MSSQL.Parameter("Province", SqlDbType.VarChar, 50, ParameterDirection.Output, Province),
                    new MSSQL.Parameter("isActivation", SqlDbType.Bit, 1, ParameterDirection.Output, isActivation),
                    new MSSQL.Parameter("SurrogateID", SqlDbType.BigInt, 8, ParameterDirection.Output, SurrogateID),
                    new MSSQL.Parameter("BV", SqlDbType.Money, 8, ParameterDirection.Output, BV),
                    new MSSQL.Parameter("BVBalanced", SqlDbType.Money, 8, ParameterDirection.Output, BVBalanced),
                    new MSSQL.Parameter("VirtualMoney", SqlDbType.Money, 8, ParameterDirection.Output, VirtualMoney),
                    new MSSQL.Parameter("VirtualMoneyBalance", SqlDbType.Money, 8, ParameterDirection.Output, VirtualMoneyBalance),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    UserID = System.Convert.ToInt64(Outputs["UserID"]);
                }
                catch { }

                try
                {
                    RealityName = System.Convert.ToString(Outputs["RealityName"]);
                }
                catch { }

                try
                {
                    Password2 = System.Convert.ToString(Outputs["Password2"]);
                }
                catch { }

                try
                {
                    Sex = System.Convert.ToString(Outputs["Sex"]);
                }
                catch { }

                try
                {
                    Birthday = System.Convert.ToString(Outputs["Birthday"]);
                }
                catch { }

                try
                {
                    CityID = System.Convert.ToInt32(Outputs["CityID"]);
                }
                catch { }

                try
                {
                    IDCardNumber = System.Convert.ToString(Outputs["IDCardNumber"]);
                }
                catch { }

                try
                {
                    Address = System.Convert.ToString(Outputs["Address"]);
                }
                catch { }

                try
                {
                    Email = System.Convert.ToString(Outputs["Email"]);
                }
                catch { }

                try
                {
                    QQ = System.Convert.ToString(Outputs["QQ"]);
                }
                catch { }

                try
                {
                    Telephone = System.Convert.ToString(Outputs["Telephone"]);
                }
                catch { }

                try
                {
                    Mobile = System.Convert.ToString(Outputs["Mobile"]);
                }
                catch { }

                try
                {
                    BankTypeID = System.Convert.ToInt16(Outputs["BankTypeID"]);
                }
                catch { }

                try
                {
                    BankNameDetail = System.Convert.ToString(Outputs["BankNameDetail"]);
                }
                catch { }

                try
                {
                    BankCardNumber = System.Convert.ToString(Outputs["BankCardNumber"]);
                }
                catch { }

                try
                {
                    BankCardName = System.Convert.ToString(Outputs["BankCardName"]);
                }
                catch { }

                try
                {
                    RegisterTime = System.Convert.ToDateTime(Outputs["RegisterTime"]);
                }
                catch { }

                try
                {
                    LastLoginTime = System.Convert.ToDateTime(Outputs["LastLoginTime"]);
                }
                catch { }

                try
                {
                    LastLoginIP = System.Convert.ToString(Outputs["LastLoginIP"]);
                }
                catch { }

                try
                {
                    LoginNum = System.Convert.ToInt32(Outputs["LoginNum"]);
                }
                catch { }

                try
                {
                    isSurrogate = System.Convert.ToBoolean(Outputs["isSurrogate"]);
                }
                catch { }

                try
                {
                    UserType = System.Convert.ToInt32(Outputs["UserType"]);
                }
                catch { }

                try
                {
                    Balance = System.Convert.ToDouble(Outputs["Balance"]);
                }
                catch { }

                try
                {
                    Freeze = System.Convert.ToDouble(Outputs["Freeze"]);
                }
                catch { }

                try
                {
                    Tax = System.Convert.ToDouble(Outputs["Tax"]);
                }
                catch { }

                try
                {
                    FundManage = System.Convert.ToDouble(Outputs["FundManage"]);
                }
                catch { }

                try
                {
                    FundManageDistill = System.Convert.ToInt32(Outputs["FundManageDistill"]);
                }
                catch { }

                try
                {
                    FundManageDistillUserSelf = System.Convert.ToInt32(Outputs["FundManageDistillUserSelf"]);
                }
                catch { }

                try
                {
                    Earning = System.Convert.ToDouble(Outputs["Earning"]);
                }
                catch { }

                try
                {
                    EarningBalanced = System.Convert.ToDouble(Outputs["EarningBalanced"]);
                }
                catch { }

                try
                {
                    EarningNets2 = System.Convert.ToDouble(Outputs["EarningNets2"]);
                }
                catch { }

                try
                {
                    EarningNets2Balanced = System.Convert.ToDouble(Outputs["EarningNets2Balanced"]);
                }
                catch { }

                try
                {
                    Earning3 = System.Convert.ToDouble(Outputs["Earning3"]);
                }
                catch { }

                try
                {
                    Earning3Balanced = System.Convert.ToDouble(Outputs["Earning3Balanced"]);
                }
                catch { }

                try
                {
                    ParentID = System.Convert.ToInt64(Outputs["ParentID"]);
                }
                catch { }

                try
                {
                    LR = System.Convert.ToInt32(Outputs["LR"]);
                }
                catch { }

                try
                {
                    CommendID = System.Convert.ToInt64(Outputs["CommendID"]);
                }
                catch { }

                try
                {
                    isCanLogin = System.Convert.ToBoolean(Outputs["isCanLogin"]);
                }
                catch { }

                try
                {
                    BankTypeName = System.Convert.ToString(Outputs["BankTypeName"]);
                }
                catch { }

                try
                {
                    City = System.Convert.ToString(Outputs["City"]);
                }
                catch { }

                try
                {
                    Province = System.Convert.ToString(Outputs["Province"]);
                }
                catch { }

                try
                {
                    isActivation = System.Convert.ToBoolean(Outputs["isActivation"]);
                }
                catch { }

                try
                {
                    SurrogateID = System.Convert.ToInt64(Outputs["SurrogateID"]);
                }
                catch { }

                try
                {
                    BV = System.Convert.ToDouble(Outputs["BV"]);
                }
                catch { }

                try
                {
                    BVBalanced = System.Convert.ToDouble(Outputs["BVBalanced"]);
                }
                catch { }

                try
                {
                    VirtualMoney = System.Convert.ToDouble(Outputs["VirtualMoney"]);
                }
                catch { }

                try
                {
                    VirtualMoneyBalance = System.Convert.ToDouble(Outputs["VirtualMoneyBalance"]);
                }
                catch { }

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(string Name, string LoginIP, string InputPassword, ref long UserID, ref string RealityName, ref string Password2, ref string Sex, ref string Birthday, ref int CityID, ref string IDCardNumber, ref string Address, ref string Email, ref string QQ, ref string Telephone, ref string Mobile, ref short BankTypeID, ref string BankNameDetail, ref string BankCardNumber, ref string BankCardName, ref DateTime RegisterTime, ref DateTime LastLoginTime, ref string LastLoginIP, ref int LoginNum, ref bool isSurrogate, ref int UserType, ref double Balance, ref double Freeze, ref double Tax, ref double FundManage, ref int FundManageDistill, ref int FundManageDistillUserSelf, ref double Earning, ref double EarningBalanced, ref double EarningNets2, ref double EarningNets2Balanced, ref double Earning3, ref double Earning3Balanced, ref long ParentID, ref int LR, ref long CommendID, ref bool isCanLogin, ref string BankTypeName, ref string City, ref string Province, ref bool isActivation, ref long SurrogateID, ref double BV, ref double BVBalanced, ref double VirtualMoney, ref double VirtualMoneyBalance, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_Login", ref Outputs,
                    new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    new MSSQL.Parameter("LoginIP", SqlDbType.VarChar, 0, ParameterDirection.Input, LoginIP),
                    new MSSQL.Parameter("InputPassword", SqlDbType.VarChar, 0, ParameterDirection.Input, InputPassword),
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 8, ParameterDirection.Output, UserID),
                    new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 50, ParameterDirection.Output, RealityName),
                    new MSSQL.Parameter("Password2", SqlDbType.VarChar, 1000, ParameterDirection.Output, Password2),
                    new MSSQL.Parameter("Sex", SqlDbType.Char, 2, ParameterDirection.Output, Sex),
                    new MSSQL.Parameter("Birthday", SqlDbType.VarChar, 20, ParameterDirection.Output, Birthday),
                    new MSSQL.Parameter("CityID", SqlDbType.Int, 4, ParameterDirection.Output, CityID),
                    new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 50, ParameterDirection.Output, IDCardNumber),
                    new MSSQL.Parameter("Address", SqlDbType.VarChar, 50, ParameterDirection.Output, Address),
                    new MSSQL.Parameter("Email", SqlDbType.VarChar, 50, ParameterDirection.Output, Email),
                    new MSSQL.Parameter("QQ", SqlDbType.VarChar, 50, ParameterDirection.Output, QQ),
                    new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 50, ParameterDirection.Output, Telephone),
                    new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 50, ParameterDirection.Output, Mobile),
                    new MSSQL.Parameter("BankTypeID", SqlDbType.SmallInt, 2, ParameterDirection.Output, BankTypeID),
                    new MSSQL.Parameter("BankNameDetail", SqlDbType.VarChar, 50, ParameterDirection.Output, BankNameDetail),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 50, ParameterDirection.Output, BankCardNumber),
                    new MSSQL.Parameter("BankCardName", SqlDbType.VarChar, 50, ParameterDirection.Output, BankCardName),
                    new MSSQL.Parameter("RegisterTime", SqlDbType.DateTime, 8, ParameterDirection.Output, RegisterTime),
                    new MSSQL.Parameter("LastLoginTime", SqlDbType.DateTime, 8, ParameterDirection.Output, LastLoginTime),
                    new MSSQL.Parameter("LastLoginIP", SqlDbType.VarChar, 50, ParameterDirection.Output, LastLoginIP),
                    new MSSQL.Parameter("LoginNum", SqlDbType.Int, 4, ParameterDirection.Output, LoginNum),
                    new MSSQL.Parameter("isSurrogate", SqlDbType.Bit, 1, ParameterDirection.Output, isSurrogate),
                    new MSSQL.Parameter("UserType", SqlDbType.Int, 4, ParameterDirection.Output, UserType),
                    new MSSQL.Parameter("Balance", SqlDbType.Money, 8, ParameterDirection.Output, Balance),
                    new MSSQL.Parameter("Freeze", SqlDbType.Money, 8, ParameterDirection.Output, Freeze),
                    new MSSQL.Parameter("Tax", SqlDbType.Money, 8, ParameterDirection.Output, Tax),
                    new MSSQL.Parameter("FundManage", SqlDbType.Money, 8, ParameterDirection.Output, FundManage),
                    new MSSQL.Parameter("FundManageDistill", SqlDbType.Int, 4, ParameterDirection.Output, FundManageDistill),
                    new MSSQL.Parameter("FundManageDistillUserSelf", SqlDbType.Int, 4, ParameterDirection.Output, FundManageDistillUserSelf),
                    new MSSQL.Parameter("Earning", SqlDbType.Money, 8, ParameterDirection.Output, Earning),
                    new MSSQL.Parameter("EarningBalanced", SqlDbType.Money, 8, ParameterDirection.Output, EarningBalanced),
                    new MSSQL.Parameter("EarningNets2", SqlDbType.Money, 8, ParameterDirection.Output, EarningNets2),
                    new MSSQL.Parameter("EarningNets2Balanced", SqlDbType.Money, 8, ParameterDirection.Output, EarningNets2Balanced),
                    new MSSQL.Parameter("Earning3", SqlDbType.Money, 8, ParameterDirection.Output, Earning3),
                    new MSSQL.Parameter("Earning3Balanced", SqlDbType.Money, 8, ParameterDirection.Output, Earning3Balanced),
                    new MSSQL.Parameter("ParentID", SqlDbType.BigInt, 8, ParameterDirection.Output, ParentID),
                    new MSSQL.Parameter("LR", SqlDbType.Int, 4, ParameterDirection.Output, LR),
                    new MSSQL.Parameter("CommendID", SqlDbType.BigInt, 8, ParameterDirection.Output, CommendID),
                    new MSSQL.Parameter("isCanLogin", SqlDbType.Bit, 1, ParameterDirection.Output, isCanLogin),
                    new MSSQL.Parameter("BankTypeName", SqlDbType.VarChar, 50, ParameterDirection.Output, BankTypeName),
                    new MSSQL.Parameter("City", SqlDbType.VarChar, 50, ParameterDirection.Output, City),
                    new MSSQL.Parameter("Province", SqlDbType.VarChar, 50, ParameterDirection.Output, Province),
                    new MSSQL.Parameter("isActivation", SqlDbType.Bit, 1, ParameterDirection.Output, isActivation),
                    new MSSQL.Parameter("SurrogateID", SqlDbType.BigInt, 8, ParameterDirection.Output, SurrogateID),
                    new MSSQL.Parameter("BV", SqlDbType.Money, 8, ParameterDirection.Output, BV),
                    new MSSQL.Parameter("BVBalanced", SqlDbType.Money, 8, ParameterDirection.Output, BVBalanced),
                    new MSSQL.Parameter("VirtualMoney", SqlDbType.Money, 8, ParameterDirection.Output, VirtualMoney),
                    new MSSQL.Parameter("VirtualMoneyBalance", SqlDbType.Money, 8, ParameterDirection.Output, VirtualMoneyBalance),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    UserID = System.Convert.ToInt64(Outputs["UserID"]);
                }
                catch { }

                try
                {
                    RealityName = System.Convert.ToString(Outputs["RealityName"]);
                }
                catch { }

                try
                {
                    Password2 = System.Convert.ToString(Outputs["Password2"]);
                }
                catch { }

                try
                {
                    Sex = System.Convert.ToString(Outputs["Sex"]);
                }
                catch { }

                try
                {
                    Birthday = System.Convert.ToString(Outputs["Birthday"]);
                }
                catch { }

                try
                {
                    CityID = System.Convert.ToInt32(Outputs["CityID"]);
                }
                catch { }

                try
                {
                    IDCardNumber = System.Convert.ToString(Outputs["IDCardNumber"]);
                }
                catch { }

                try
                {
                    Address = System.Convert.ToString(Outputs["Address"]);
                }
                catch { }

                try
                {
                    Email = System.Convert.ToString(Outputs["Email"]);
                }
                catch { }

                try
                {
                    QQ = System.Convert.ToString(Outputs["QQ"]);
                }
                catch { }

                try
                {
                    Telephone = System.Convert.ToString(Outputs["Telephone"]);
                }
                catch { }

                try
                {
                    Mobile = System.Convert.ToString(Outputs["Mobile"]);
                }
                catch { }

                try
                {
                    BankTypeID = System.Convert.ToInt16(Outputs["BankTypeID"]);
                }
                catch { }

                try
                {
                    BankNameDetail = System.Convert.ToString(Outputs["BankNameDetail"]);
                }
                catch { }

                try
                {
                    BankCardNumber = System.Convert.ToString(Outputs["BankCardNumber"]);
                }
                catch { }

                try
                {
                    BankCardName = System.Convert.ToString(Outputs["BankCardName"]);
                }
                catch { }

                try
                {
                    RegisterTime = System.Convert.ToDateTime(Outputs["RegisterTime"]);
                }
                catch { }

                try
                {
                    LastLoginTime = System.Convert.ToDateTime(Outputs["LastLoginTime"]);
                }
                catch { }

                try
                {
                    LastLoginIP = System.Convert.ToString(Outputs["LastLoginIP"]);
                }
                catch { }

                try
                {
                    LoginNum = System.Convert.ToInt32(Outputs["LoginNum"]);
                }
                catch { }

                try
                {
                    isSurrogate = System.Convert.ToBoolean(Outputs["isSurrogate"]);
                }
                catch { }

                try
                {
                    UserType = System.Convert.ToInt32(Outputs["UserType"]);
                }
                catch { }

                try
                {
                    Balance = System.Convert.ToDouble(Outputs["Balance"]);
                }
                catch { }

                try
                {
                    Freeze = System.Convert.ToDouble(Outputs["Freeze"]);
                }
                catch { }

                try
                {
                    Tax = System.Convert.ToDouble(Outputs["Tax"]);
                }
                catch { }

                try
                {
                    FundManage = System.Convert.ToDouble(Outputs["FundManage"]);
                }
                catch { }

                try
                {
                    FundManageDistill = System.Convert.ToInt32(Outputs["FundManageDistill"]);
                }
                catch { }

                try
                {
                    FundManageDistillUserSelf = System.Convert.ToInt32(Outputs["FundManageDistillUserSelf"]);
                }
                catch { }

                try
                {
                    Earning = System.Convert.ToDouble(Outputs["Earning"]);
                }
                catch { }

                try
                {
                    EarningBalanced = System.Convert.ToDouble(Outputs["EarningBalanced"]);
                }
                catch { }

                try
                {
                    EarningNets2 = System.Convert.ToDouble(Outputs["EarningNets2"]);
                }
                catch { }

                try
                {
                    EarningNets2Balanced = System.Convert.ToDouble(Outputs["EarningNets2Balanced"]);
                }
                catch { }

                try
                {
                    Earning3 = System.Convert.ToDouble(Outputs["Earning3"]);
                }
                catch { }

                try
                {
                    Earning3Balanced = System.Convert.ToDouble(Outputs["Earning3Balanced"]);
                }
                catch { }

                try
                {
                    ParentID = System.Convert.ToInt64(Outputs["ParentID"]);
                }
                catch { }

                try
                {
                    LR = System.Convert.ToInt32(Outputs["LR"]);
                }
                catch { }

                try
                {
                    CommendID = System.Convert.ToInt64(Outputs["CommendID"]);
                }
                catch { }

                try
                {
                    isCanLogin = System.Convert.ToBoolean(Outputs["isCanLogin"]);
                }
                catch { }

                try
                {
                    BankTypeName = System.Convert.ToString(Outputs["BankTypeName"]);
                }
                catch { }

                try
                {
                    City = System.Convert.ToString(Outputs["City"]);
                }
                catch { }

                try
                {
                    Province = System.Convert.ToString(Outputs["Province"]);
                }
                catch { }

                try
                {
                    isActivation = System.Convert.ToBoolean(Outputs["isActivation"]);
                }
                catch { }

                try
                {
                    SurrogateID = System.Convert.ToInt64(Outputs["SurrogateID"]);
                }
                catch { }

                try
                {
                    BV = System.Convert.ToDouble(Outputs["BV"]);
                }
                catch { }

                try
                {
                    BVBalanced = System.Convert.ToDouble(Outputs["BVBalanced"]);
                }
                catch { }

                try
                {
                    VirtualMoney = System.Convert.ToDouble(Outputs["VirtualMoney"]);
                }
                catch { }

                try
                {
                    VirtualMoneyBalance = System.Convert.ToDouble(Outputs["VirtualMoneyBalance"]);
                }
                catch { }

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_OpLogList
        {
            public static int Call(DateTime StartDate, DateTime endDate)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_OpLogList", ref Outputs,
                    new MSSQL.Parameter("StartDate", SqlDbType.DateTime, 0, ParameterDirection.Input, StartDate),
                    new MSSQL.Parameter("endDate", SqlDbType.DateTime, 0, ParameterDirection.Input, endDate)
                    );

                return CallResult;
            }

            public static DataSet Open(DateTime StartDate, DateTime endDate)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_OpLogList", ref Outputs,
                    new MSSQL.Parameter("StartDate", SqlDbType.DateTime, 0, ParameterDirection.Input, StartDate),
                    new MSSQL.Parameter("endDate", SqlDbType.DateTime, 0, ParameterDirection.Input, endDate)
                    );

                return ds;
            }
        }

        public class P_RiskEarning
        {
            public static int Call()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_RiskEarning", ref Outputs);

                return CallResult;
            }

            public static DataSet Open()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_RiskEarning", ref Outputs);

                return ds;
            }
        }

        public class P_OpLogUserIDList
        {
            public static int Call(long UserID)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_OpLogUserIDList", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID)
                    );

                return CallResult;
            }

            public static DataSet Open(long UserID)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_OpLogUserIDList", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID)
                    );

                return ds;
            }
        }

        public class P_PaymentDefeat
        {
            public static int Call(string FileName, int PaymentType, int OperatorType)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_PaymentDefeat", ref Outputs,
                    new MSSQL.Parameter("FileName", SqlDbType.VarChar, 0, ParameterDirection.Input, FileName),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("OperatorType", SqlDbType.Int, 0, ParameterDirection.Input, OperatorType)
                    );

                return CallResult;
            }

            public static DataSet Open(string FileName, int PaymentType, int OperatorType)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_PaymentDefeat", ref Outputs,
                    new MSSQL.Parameter("FileName", SqlDbType.VarChar, 0, ParameterDirection.Input, FileName),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("OperatorType", SqlDbType.Int, 0, ParameterDirection.Input, OperatorType)
                    );

                return ds;
            }
        }

        public class P_PaymentDefeatOnlyOne
        {
            public static int Call(long ID, int PaymentType, int OperatorType)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_PaymentDefeatOnlyOne", ref Outputs,
                    new MSSQL.Parameter("ID", SqlDbType.BigInt, 0, ParameterDirection.Input, ID),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("OperatorType", SqlDbType.Int, 0, ParameterDirection.Input, OperatorType)
                    );

                return CallResult;
            }

            public static DataSet Open(long ID, int PaymentType, int OperatorType)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_PaymentDefeatOnlyOne", ref Outputs,
                    new MSSQL.Parameter("ID", SqlDbType.BigInt, 0, ParameterDirection.Input, ID),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("OperatorType", SqlDbType.Int, 0, ParameterDirection.Input, OperatorType)
                    );

                return ds;
            }
        }

        public class P_ReBuy
        {
            public static int Call(long SurrogateID, long UserID, int UserType, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_ReBuy", ref Outputs,
                    new MSSQL.Parameter("SurrogateID", SqlDbType.BigInt, 0, ParameterDirection.Input, SurrogateID),
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("UserType", SqlDbType.Int, 0, ParameterDirection.Input, UserType),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long SurrogateID, long UserID, int UserType, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_ReBuy", ref Outputs,
                    new MSSQL.Parameter("SurrogateID", SqlDbType.BigInt, 0, ParameterDirection.Input, SurrogateID),
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("UserType", SqlDbType.Int, 0, ParameterDirection.Input, UserType),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_ReturnFundManage_All
        {
            public static int Call()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_ReturnFundManage_All", ref Outputs);

                return CallResult;
            }

            public static DataSet Open()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_ReturnFundManage_All", ref Outputs);

                return ds;
            }
        }

        public class P_DistillRiskMoney
        {
            public static int Call(long UserID, double RiskMoney, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_DistillRiskMoney", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("RiskMoney", SqlDbType.Money, 0, ParameterDirection.Input, RiskMoney),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 20, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, double RiskMoney, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_DistillRiskMoney", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("RiskMoney", SqlDbType.Money, 0, ParameterDirection.Input, RiskMoney),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 20, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_SetCost
        {
            public static int Call(long HandleOperatorID, double Cost, double RealCost, ref long CostID, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_SetCost", ref Outputs,
                    new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    new MSSQL.Parameter("Cost", SqlDbType.Money, 0, ParameterDirection.Input, Cost),
                    new MSSQL.Parameter("RealCost", SqlDbType.Money, 0, ParameterDirection.Input, RealCost),
                    new MSSQL.Parameter("CostID", SqlDbType.BigInt, 8, ParameterDirection.Output, CostID),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    CostID = System.Convert.ToInt64(Outputs["CostID"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long HandleOperatorID, double Cost, double RealCost, ref long CostID, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_SetCost", ref Outputs,
                    new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    new MSSQL.Parameter("Cost", SqlDbType.Money, 0, ParameterDirection.Input, Cost),
                    new MSSQL.Parameter("RealCost", SqlDbType.Money, 0, ParameterDirection.Input, RealCost),
                    new MSSQL.Parameter("CostID", SqlDbType.BigInt, 8, ParameterDirection.Output, CostID),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    CostID = System.Convert.ToInt64(Outputs["CostID"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_SetUserCompetences
        {
            public static int Call(long UserID, string CompetencesList, string GroupsList, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_SetUserCompetences", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("CompetencesList", SqlDbType.VarChar, 0, ParameterDirection.Input, CompetencesList),
                    new MSSQL.Parameter("GroupsList", SqlDbType.VarChar, 0, ParameterDirection.Input, GroupsList),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, string CompetencesList, string GroupsList, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_SetUserCompetences", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("CompetencesList", SqlDbType.VarChar, 0, ParameterDirection.Input, CompetencesList),
                    new MSSQL.Parameter("GroupsList", SqlDbType.VarChar, 0, ParameterDirection.Input, GroupsList),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_TryForSurrogate
        {
            public static int Call(long UserID, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_TryForSurrogate", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_TryForSurrogate", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_TryForSurrogateDeal
        {
            public static int Call(int TryForID, bool DealResult, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_TryForSurrogateDeal", ref Outputs,
                    new MSSQL.Parameter("TryForID", SqlDbType.Int, 0, ParameterDirection.Input, TryForID),
                    new MSSQL.Parameter("DealResult", SqlDbType.Bit, 0, ParameterDirection.Input, DealResult),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(int TryForID, bool DealResult, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_TryForSurrogateDeal", ref Outputs,
                    new MSSQL.Parameter("TryForID", SqlDbType.Int, 0, ParameterDirection.Input, TryForID),
                    new MSSQL.Parameter("DealResult", SqlDbType.Bit, 0, ParameterDirection.Input, DealResult),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_UserAdd
        {
            public static int Call(string Name, string RealityName, string Password, string Password2, string Sex, string Birthday, int CityID, string IDCardNumber, string Address, string Email, string QQ, string Telephone, string Mobile, short BankTypeID, string BankNameDetail, string BankCardNumber, string BankCardName, int UserType, long ParentID, int LR, long CommendID, bool AutoNext, bool NewUserisSurrogate, bool isActivation, long SurrogateID, ref long UserID, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserAdd", ref Outputs,
                    new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 0, ParameterDirection.Input, RealityName),
                    new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password),
                    new MSSQL.Parameter("Password2", SqlDbType.VarChar, 0, ParameterDirection.Input, Password2),
                    new MSSQL.Parameter("Sex", SqlDbType.Char, 0, ParameterDirection.Input, Sex),
                    new MSSQL.Parameter("Birthday", SqlDbType.VarChar, 0, ParameterDirection.Input, Birthday),
                    new MSSQL.Parameter("CityID", SqlDbType.Int, 0, ParameterDirection.Input, CityID),
                    new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, IDCardNumber),
                    new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address),
                    new MSSQL.Parameter("Email", SqlDbType.VarChar, 0, ParameterDirection.Input, Email),
                    new MSSQL.Parameter("QQ", SqlDbType.VarChar, 0, ParameterDirection.Input, QQ),
                    new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 0, ParameterDirection.Input, Telephone),
                    new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 0, ParameterDirection.Input, Mobile),
                    new MSSQL.Parameter("BankTypeID", SqlDbType.SmallInt, 0, ParameterDirection.Input, BankTypeID),
                    new MSSQL.Parameter("BankNameDetail", SqlDbType.VarChar, 0, ParameterDirection.Input, BankNameDetail),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("BankCardName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardName),
                    new MSSQL.Parameter("UserType", SqlDbType.Int, 0, ParameterDirection.Input, UserType),
                    new MSSQL.Parameter("ParentID", SqlDbType.BigInt, 0, ParameterDirection.Input, ParentID),
                    new MSSQL.Parameter("LR", SqlDbType.Int, 0, ParameterDirection.Input, LR),
                    new MSSQL.Parameter("CommendID", SqlDbType.BigInt, 0, ParameterDirection.Input, CommendID),
                    new MSSQL.Parameter("AutoNext", SqlDbType.Bit, 0, ParameterDirection.Input, AutoNext),
                    new MSSQL.Parameter("NewUserisSurrogate", SqlDbType.Bit, 0, ParameterDirection.Input, NewUserisSurrogate),
                    new MSSQL.Parameter("isActivation", SqlDbType.Bit, 0, ParameterDirection.Input, isActivation),
                    new MSSQL.Parameter("SurrogateID", SqlDbType.BigInt, 0, ParameterDirection.Input, SurrogateID),
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 8, ParameterDirection.Output, UserID),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    UserID = System.Convert.ToInt64(Outputs["UserID"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(string Name, string RealityName, string Password, string Password2, string Sex, string Birthday, int CityID, string IDCardNumber, string Address, string Email, string QQ, string Telephone, string Mobile, short BankTypeID, string BankNameDetail, string BankCardNumber, string BankCardName, int UserType, long ParentID, int LR, long CommendID, bool AutoNext, bool NewUserisSurrogate, bool isActivation, long SurrogateID, ref long UserID, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserAdd", ref Outputs,
                    new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 0, ParameterDirection.Input, RealityName),
                    new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password),
                    new MSSQL.Parameter("Password2", SqlDbType.VarChar, 0, ParameterDirection.Input, Password2),
                    new MSSQL.Parameter("Sex", SqlDbType.Char, 0, ParameterDirection.Input, Sex),
                    new MSSQL.Parameter("Birthday", SqlDbType.VarChar, 0, ParameterDirection.Input, Birthday),
                    new MSSQL.Parameter("CityID", SqlDbType.Int, 0, ParameterDirection.Input, CityID),
                    new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, IDCardNumber),
                    new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address),
                    new MSSQL.Parameter("Email", SqlDbType.VarChar, 0, ParameterDirection.Input, Email),
                    new MSSQL.Parameter("QQ", SqlDbType.VarChar, 0, ParameterDirection.Input, QQ),
                    new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 0, ParameterDirection.Input, Telephone),
                    new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 0, ParameterDirection.Input, Mobile),
                    new MSSQL.Parameter("BankTypeID", SqlDbType.SmallInt, 0, ParameterDirection.Input, BankTypeID),
                    new MSSQL.Parameter("BankNameDetail", SqlDbType.VarChar, 0, ParameterDirection.Input, BankNameDetail),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("BankCardName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardName),
                    new MSSQL.Parameter("UserType", SqlDbType.Int, 0, ParameterDirection.Input, UserType),
                    new MSSQL.Parameter("ParentID", SqlDbType.BigInt, 0, ParameterDirection.Input, ParentID),
                    new MSSQL.Parameter("LR", SqlDbType.Int, 0, ParameterDirection.Input, LR),
                    new MSSQL.Parameter("CommendID", SqlDbType.BigInt, 0, ParameterDirection.Input, CommendID),
                    new MSSQL.Parameter("AutoNext", SqlDbType.Bit, 0, ParameterDirection.Input, AutoNext),
                    new MSSQL.Parameter("NewUserisSurrogate", SqlDbType.Bit, 0, ParameterDirection.Input, NewUserisSurrogate),
                    new MSSQL.Parameter("isActivation", SqlDbType.Bit, 0, ParameterDirection.Input, isActivation),
                    new MSSQL.Parameter("SurrogateID", SqlDbType.BigInt, 0, ParameterDirection.Input, SurrogateID),
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 8, ParameterDirection.Output, UserID),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    UserID = System.Convert.ToInt64(Outputs["UserID"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_UserAddMoney
        {
            public static int Call(long UserID, double Money, double FormalitiesFees, string PayNumber, string Memo, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserAddMoney", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("FormalitiesFees", SqlDbType.Money, 0, ParameterDirection.Input, FormalitiesFees),
                    new MSSQL.Parameter("PayNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, PayNumber),
                    new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, double Money, double FormalitiesFees, string PayNumber, string Memo, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserAddMoney", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("FormalitiesFees", SqlDbType.Money, 0, ParameterDirection.Input, FormalitiesFees),
                    new MSSQL.Parameter("PayNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, PayNumber),
                    new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_UserAddMoneyManual
        {
            public static int Call(long UserID, long OperatorID, double Money, string memo, ref int Result, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserAddMoneyManual", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("OperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, OperatorID),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("memo", SqlDbType.VarChar, 0, ParameterDirection.Input, memo),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, long OperatorID, double Money, string memo, ref int Result, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserAddMoneyManual", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("OperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, OperatorID),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("memo", SqlDbType.VarChar, 0, ParameterDirection.Input, memo),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GetUserVirtualDetail
        {
            public static int Call(long UserID, int Year, int Month)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetUserVirtualDetail", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year),
                    new MSSQL.Parameter("Month", SqlDbType.Int, 0, ParameterDirection.Input, Month)
                    );

                return CallResult;
            }

            public static DataSet Open(long UserID, int Year, int Month)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetUserVirtualDetail", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year),
                    new MSSQL.Parameter("Month", SqlDbType.Int, 0, ParameterDirection.Input, Month)
                    );

                return ds;
            }
        }

        public class P_UserDistill
        {
            public static int Call(long UserID, double Money, string BankTypeName, string BankCardNumber, string Memo, double DistillFormalitiesFeesScale, long HandleOperatorID, int PaymentType, long PaymentFilesID, int Type, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserDistill", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("BankTypeName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankTypeName),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    new MSSQL.Parameter("DistillFormalitiesFeesScale", SqlDbType.Money, 0, ParameterDirection.Input, DistillFormalitiesFeesScale),
                    new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("PaymentFilesID", SqlDbType.BigInt, 0, ParameterDirection.Input, PaymentFilesID),
                    new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, double Money, string BankTypeName, string BankCardNumber, string Memo, double DistillFormalitiesFeesScale, long HandleOperatorID, int PaymentType, long PaymentFilesID, int Type, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserDistill", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("BankTypeName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankTypeName),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    new MSSQL.Parameter("DistillFormalitiesFeesScale", SqlDbType.Money, 0, ParameterDirection.Input, DistillFormalitiesFeesScale),
                    new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("PaymentFilesID", SqlDbType.BigInt, 0, ParameterDirection.Input, PaymentFilesID),
                    new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_UserDistillAdd
        {
            public static int Call(long UserID, double Money, string BankName, string BankCardNumber, string Memo, ref int Result, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserDistillAdd", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("BankName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankName),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, double Money, string BankName, string BankCardNumber, string Memo, ref int Result, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserDistillAdd", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("BankName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankName),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_UserDistillAll
        {
            public static int Call(long HandleOperatorID, int PaymentType, long PaymentFilesID, int Type, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserDistillAll", ref Outputs,
                    new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("PaymentFilesID", SqlDbType.BigInt, 0, ParameterDirection.Input, PaymentFilesID),
                    new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long HandleOperatorID, int PaymentType, long PaymentFilesID, int Type, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserDistillAll", ref Outputs,
                    new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("PaymentFilesID", SqlDbType.BigInt, 0, ParameterDirection.Input, PaymentFilesID),
                    new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_UserDistillAllForNets_2
        {
            public static int Call()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserDistillAllForNets_2", ref Outputs);

                return CallResult;
            }

            public static DataSet Open()
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserDistillAllForNets_2", ref Outputs);

                return ds;
            }
        }

        public class P_GetUserBvDetail
        {
            public static int Call(long UserID, int Year, int Month)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetUserBvDetail", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year),
                    new MSSQL.Parameter("Month", SqlDbType.Int, 0, ParameterDirection.Input, Month)
                    );

                return CallResult;
            }

            public static DataSet Open(long UserID, int Year, int Month)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetUserBvDetail", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Year", SqlDbType.Int, 0, ParameterDirection.Input, Year),
                    new MSSQL.Parameter("Month", SqlDbType.Int, 0, ParameterDirection.Input, Month)
                    );

                return ds;
            }
        }

        public class P_UserDistillAll_3
        {
            public static int Call(long HandleOperatorID, int PaymentType, long PaymentFilesID, int Type, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserDistillAll_3", ref Outputs,
                    new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("PaymentFilesID", SqlDbType.BigInt, 0, ParameterDirection.Input, PaymentFilesID),
                    new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long HandleOperatorID, int PaymentType, long PaymentFilesID, int Type, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserDistillAll_3", ref Outputs,
                    new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("PaymentFilesID", SqlDbType.BigInt, 0, ParameterDirection.Input, PaymentFilesID),
                    new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_UserDistillForNets_2
        {
            public static int Call(long UserID, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserDistillForNets_2", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserDistillForNets_2", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_UserDistillUpdate
        {
            public static int Call(long ID, long UserID, double Money, long HandleOperatorID, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserDistillUpdate", ref Outputs,
                    new MSSQL.Parameter("ID", SqlDbType.BigInt, 0, ParameterDirection.Input, ID),
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long ID, long UserID, double Money, long HandleOperatorID, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserDistillUpdate", ref Outputs,
                    new MSSQL.Parameter("ID", SqlDbType.BigInt, 0, ParameterDirection.Input, ID),
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_UserDistill_3
        {
            public static int Call(long UserID, double Money, string BankTypeName, string BankCardNumber, string Memo, double DistillFormalitiesFeesScale, long HandleOperatorID, int PaymentType, long PaymentFilesID, int Type, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserDistill_3", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("BankTypeName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankTypeName),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    new MSSQL.Parameter("DistillFormalitiesFeesScale", SqlDbType.Money, 0, ParameterDirection.Input, DistillFormalitiesFeesScale),
                    new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("PaymentFilesID", SqlDbType.BigInt, 0, ParameterDirection.Input, PaymentFilesID),
                    new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, double Money, string BankTypeName, string BankCardNumber, string Memo, double DistillFormalitiesFeesScale, long HandleOperatorID, int PaymentType, long PaymentFilesID, int Type, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserDistill_3", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("BankTypeName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankTypeName),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("Memo", SqlDbType.VarChar, 0, ParameterDirection.Input, Memo),
                    new MSSQL.Parameter("DistillFormalitiesFeesScale", SqlDbType.Money, 0, ParameterDirection.Input, DistillFormalitiesFeesScale),
                    new MSSQL.Parameter("HandleOperatorID", SqlDbType.BigInt, 0, ParameterDirection.Input, HandleOperatorID),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("PaymentFilesID", SqlDbType.BigInt, 0, ParameterDirection.Input, PaymentFilesID),
                    new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_UserDistills
        {
            public static int Call(string UserIDs, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserDistills", ref Outputs,
                    new MSSQL.Parameter("UserIDs", SqlDbType.VarChar, 0, ParameterDirection.Input, UserIDs),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(string UserIDs, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserDistills", ref Outputs,
                    new MSSQL.Parameter("UserIDs", SqlDbType.VarChar, 0, ParameterDirection.Input, UserIDs),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_UserDistillsUpdate
        {
            public static int Call(string FileName, string IDs, int PaymentType, int OperatorType)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserDistillsUpdate", ref Outputs,
                    new MSSQL.Parameter("FileName", SqlDbType.VarChar, 0, ParameterDirection.Input, FileName),
                    new MSSQL.Parameter("IDs", SqlDbType.VarChar, 0, ParameterDirection.Input, IDs),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("OperatorType", SqlDbType.Int, 0, ParameterDirection.Input, OperatorType)
                    );

                return CallResult;
            }

            public static DataSet Open(string FileName, string IDs, int PaymentType, int OperatorType)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserDistillsUpdate", ref Outputs,
                    new MSSQL.Parameter("FileName", SqlDbType.VarChar, 0, ParameterDirection.Input, FileName),
                    new MSSQL.Parameter("IDs", SqlDbType.VarChar, 0, ParameterDirection.Input, IDs),
                    new MSSQL.Parameter("PaymentType", SqlDbType.Int, 0, ParameterDirection.Input, PaymentType),
                    new MSSQL.Parameter("OperatorType", SqlDbType.Int, 0, ParameterDirection.Input, OperatorType)
                    );

                return ds;
            }
        }

        public class P_UserEditByID
        {
            public static int Call(string RealityName, string Password, string Password2, string Sex, string Birthday, int CityID, string IDCardNumber, string Address, string Email, string QQ, string Telephone, string Mobile, short BankTypeID, string BankNameDetail, string BankCardNumber, string BankCardName, bool isSurrogate, long UserID, int UserType, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserEditByID", ref Outputs,
                    new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 0, ParameterDirection.Input, RealityName),
                    new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password),
                    new MSSQL.Parameter("Password2", SqlDbType.VarChar, 0, ParameterDirection.Input, Password2),
                    new MSSQL.Parameter("Sex", SqlDbType.Char, 0, ParameterDirection.Input, Sex),
                    new MSSQL.Parameter("Birthday", SqlDbType.VarChar, 0, ParameterDirection.Input, Birthday),
                    new MSSQL.Parameter("CityID", SqlDbType.Int, 0, ParameterDirection.Input, CityID),
                    new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, IDCardNumber),
                    new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address),
                    new MSSQL.Parameter("Email", SqlDbType.VarChar, 0, ParameterDirection.Input, Email),
                    new MSSQL.Parameter("QQ", SqlDbType.VarChar, 0, ParameterDirection.Input, QQ),
                    new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 0, ParameterDirection.Input, Telephone),
                    new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 0, ParameterDirection.Input, Mobile),
                    new MSSQL.Parameter("BankTypeID", SqlDbType.SmallInt, 0, ParameterDirection.Input, BankTypeID),
                    new MSSQL.Parameter("BankNameDetail", SqlDbType.VarChar, 0, ParameterDirection.Input, BankNameDetail),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("BankCardName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardName),
                    new MSSQL.Parameter("isSurrogate", SqlDbType.Bit, 0, ParameterDirection.Input, isSurrogate),
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("UserType", SqlDbType.Int, 0, ParameterDirection.Input, UserType),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(string RealityName, string Password, string Password2, string Sex, string Birthday, int CityID, string IDCardNumber, string Address, string Email, string QQ, string Telephone, string Mobile, short BankTypeID, string BankNameDetail, string BankCardNumber, string BankCardName, bool isSurrogate, long UserID, int UserType, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserEditByID", ref Outputs,
                    new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 0, ParameterDirection.Input, RealityName),
                    new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password),
                    new MSSQL.Parameter("Password2", SqlDbType.VarChar, 0, ParameterDirection.Input, Password2),
                    new MSSQL.Parameter("Sex", SqlDbType.Char, 0, ParameterDirection.Input, Sex),
                    new MSSQL.Parameter("Birthday", SqlDbType.VarChar, 0, ParameterDirection.Input, Birthday),
                    new MSSQL.Parameter("CityID", SqlDbType.Int, 0, ParameterDirection.Input, CityID),
                    new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, IDCardNumber),
                    new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address),
                    new MSSQL.Parameter("Email", SqlDbType.VarChar, 0, ParameterDirection.Input, Email),
                    new MSSQL.Parameter("QQ", SqlDbType.VarChar, 0, ParameterDirection.Input, QQ),
                    new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 0, ParameterDirection.Input, Telephone),
                    new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 0, ParameterDirection.Input, Mobile),
                    new MSSQL.Parameter("BankTypeID", SqlDbType.SmallInt, 0, ParameterDirection.Input, BankTypeID),
                    new MSSQL.Parameter("BankNameDetail", SqlDbType.VarChar, 0, ParameterDirection.Input, BankNameDetail),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("BankCardName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardName),
                    new MSSQL.Parameter("isSurrogate", SqlDbType.Bit, 0, ParameterDirection.Input, isSurrogate),
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("UserType", SqlDbType.Int, 0, ParameterDirection.Input, UserType),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_UserEditByName
        {
            public static int Call(string RealityName, string Password, string Password2, string Sex, string Birthday, int CityID, string IDCardNumber, string Address, string Email, string QQ, string Telephone, string Mobile, short BankTypeID, string BankNameDetail, string BankCardNumber, string BankCardName, bool isSurrogate, string Name, int UserType, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_UserEditByName", ref Outputs,
                    new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 0, ParameterDirection.Input, RealityName),
                    new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password),
                    new MSSQL.Parameter("Password2", SqlDbType.VarChar, 0, ParameterDirection.Input, Password2),
                    new MSSQL.Parameter("Sex", SqlDbType.Char, 0, ParameterDirection.Input, Sex),
                    new MSSQL.Parameter("Birthday", SqlDbType.VarChar, 0, ParameterDirection.Input, Birthday),
                    new MSSQL.Parameter("CityID", SqlDbType.Int, 0, ParameterDirection.Input, CityID),
                    new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, IDCardNumber),
                    new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address),
                    new MSSQL.Parameter("Email", SqlDbType.VarChar, 0, ParameterDirection.Input, Email),
                    new MSSQL.Parameter("QQ", SqlDbType.VarChar, 0, ParameterDirection.Input, QQ),
                    new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 0, ParameterDirection.Input, Telephone),
                    new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 0, ParameterDirection.Input, Mobile),
                    new MSSQL.Parameter("BankTypeID", SqlDbType.SmallInt, 0, ParameterDirection.Input, BankTypeID),
                    new MSSQL.Parameter("BankNameDetail", SqlDbType.VarChar, 0, ParameterDirection.Input, BankNameDetail),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("BankCardName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardName),
                    new MSSQL.Parameter("isSurrogate", SqlDbType.Bit, 0, ParameterDirection.Input, isSurrogate),
                    new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    new MSSQL.Parameter("UserType", SqlDbType.Int, 0, ParameterDirection.Input, UserType),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(string RealityName, string Password, string Password2, string Sex, string Birthday, int CityID, string IDCardNumber, string Address, string Email, string QQ, string Telephone, string Mobile, short BankTypeID, string BankNameDetail, string BankCardNumber, string BankCardName, bool isSurrogate, string Name, int UserType, ref int Result, ref string Return)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_UserEditByName", ref Outputs,
                    new MSSQL.Parameter("RealityName", SqlDbType.VarChar, 0, ParameterDirection.Input, RealityName),
                    new MSSQL.Parameter("Password", SqlDbType.VarChar, 0, ParameterDirection.Input, Password),
                    new MSSQL.Parameter("Password2", SqlDbType.VarChar, 0, ParameterDirection.Input, Password2),
                    new MSSQL.Parameter("Sex", SqlDbType.Char, 0, ParameterDirection.Input, Sex),
                    new MSSQL.Parameter("Birthday", SqlDbType.VarChar, 0, ParameterDirection.Input, Birthday),
                    new MSSQL.Parameter("CityID", SqlDbType.Int, 0, ParameterDirection.Input, CityID),
                    new MSSQL.Parameter("IDCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, IDCardNumber),
                    new MSSQL.Parameter("Address", SqlDbType.VarChar, 0, ParameterDirection.Input, Address),
                    new MSSQL.Parameter("Email", SqlDbType.VarChar, 0, ParameterDirection.Input, Email),
                    new MSSQL.Parameter("QQ", SqlDbType.VarChar, 0, ParameterDirection.Input, QQ),
                    new MSSQL.Parameter("Telephone", SqlDbType.VarChar, 0, ParameterDirection.Input, Telephone),
                    new MSSQL.Parameter("Mobile", SqlDbType.VarChar, 0, ParameterDirection.Input, Mobile),
                    new MSSQL.Parameter("BankTypeID", SqlDbType.SmallInt, 0, ParameterDirection.Input, BankTypeID),
                    new MSSQL.Parameter("BankNameDetail", SqlDbType.VarChar, 0, ParameterDirection.Input, BankNameDetail),
                    new MSSQL.Parameter("BankCardNumber", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardNumber),
                    new MSSQL.Parameter("BankCardName", SqlDbType.VarChar, 0, ParameterDirection.Input, BankCardName),
                    new MSSQL.Parameter("isSurrogate", SqlDbType.Bit, 0, ParameterDirection.Input, isSurrogate),
                    new MSSQL.Parameter("Name", SqlDbType.VarChar, 0, ParameterDirection.Input, Name),
                    new MSSQL.Parameter("UserType", SqlDbType.Int, 0, ParameterDirection.Input, UserType),
                    new MSSQL.Parameter("Result", SqlDbType.Int, 4, ParameterDirection.Output, Result),
                    new MSSQL.Parameter("Return", SqlDbType.VarChar, 100, ParameterDirection.Output, Return)
                    );

                try
                {
                    Result = System.Convert.ToInt32(Outputs["Result"]);
                }
                catch { }

                try
                {
                    Return = System.Convert.ToString(Outputs["Return"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_MGetOptions
        {
            public static int Call(ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_MGetOptions", ref Outputs,
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_MGetOptions", ref Outputs,
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_MSetOption
        {
            public static int Call(string Key, string Value, ref string RetrunDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_MSetOption", ref Outputs,
                    new MSSQL.Parameter("Key", SqlDbType.VarChar, 0, ParameterDirection.Input, Key),
                    new MSSQL.Parameter("Value", SqlDbType.VarChar, 0, ParameterDirection.Input, Value),
                    new MSSQL.Parameter("RetrunDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, RetrunDescription)
                    );

                try
                {
                    RetrunDescription = System.Convert.ToString(Outputs["RetrunDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(string Key, string Value, ref string RetrunDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_MSetOption", ref Outputs,
                    new MSSQL.Parameter("Key", SqlDbType.VarChar, 0, ParameterDirection.Input, Key),
                    new MSSQL.Parameter("Value", SqlDbType.VarChar, 0, ParameterDirection.Input, Value),
                    new MSSQL.Parameter("RetrunDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, RetrunDescription)
                    );

                try
                {
                    RetrunDescription = System.Convert.ToString(Outputs["RetrunDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_MSetOptionBinary
        {
            public static int Call(string Key, byte[] Value, ref string RetrunDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_MSetOptionBinary", ref Outputs,
                    new MSSQL.Parameter("Key", SqlDbType.VarChar, 0, ParameterDirection.Input, Key),
                    new MSSQL.Parameter("Value", SqlDbType.Image, 0, ParameterDirection.Input, Value),
                    new MSSQL.Parameter("RetrunDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, RetrunDescription)
                    );

                try
                {
                    RetrunDescription = System.Convert.ToString(Outputs["RetrunDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(string Key, byte[] Value, ref string RetrunDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_MSetOptionBinary", ref Outputs,
                    new MSSQL.Parameter("Key", SqlDbType.VarChar, 0, ParameterDirection.Input, Key),
                    new MSSQL.Parameter("Value", SqlDbType.Image, 0, ParameterDirection.Input, Value),
                    new MSSQL.Parameter("RetrunDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, RetrunDescription)
                    );

                try
                {
                    RetrunDescription = System.Convert.ToString(Outputs["RetrunDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_BuyForNets_2_UserSelf
        {
            public static int Call(long UserID, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_BuyForNets_2_UserSelf", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_BuyForNets_2_UserSelf", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_WriteSMS
        {
            public static int Call(long SMSID, string From, string To, string Content, ref long NewSMSID)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_WriteSMS", ref Outputs,
                    new MSSQL.Parameter("SMSID", SqlDbType.BigInt, 0, ParameterDirection.Input, SMSID),
                    new MSSQL.Parameter("From", SqlDbType.VarChar, 0, ParameterDirection.Input, From),
                    new MSSQL.Parameter("To", SqlDbType.VarChar, 0, ParameterDirection.Input, To),
                    new MSSQL.Parameter("Content", SqlDbType.VarChar, 0, ParameterDirection.Input, Content),
                    new MSSQL.Parameter("NewSMSID", SqlDbType.BigInt, 8, ParameterDirection.Output, NewSMSID)
                    );

                try
                {
                    NewSMSID = System.Convert.ToInt64(Outputs["NewSMSID"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long SMSID, string From, string To, string Content, ref long NewSMSID)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_WriteSMS", ref Outputs,
                    new MSSQL.Parameter("SMSID", SqlDbType.BigInt, 0, ParameterDirection.Input, SMSID),
                    new MSSQL.Parameter("From", SqlDbType.VarChar, 0, ParameterDirection.Input, From),
                    new MSSQL.Parameter("To", SqlDbType.VarChar, 0, ParameterDirection.Input, To),
                    new MSSQL.Parameter("Content", SqlDbType.VarChar, 0, ParameterDirection.Input, Content),
                    new MSSQL.Parameter("NewSMSID", SqlDbType.BigInt, 8, ParameterDirection.Output, NewSMSID)
                    );

                try
                {
                    NewSMSID = System.Convert.ToInt64(Outputs["NewSMSID"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GetNetForUser
        {
            public static int Call(long UserID, DateTime StartTime, DateTime EndTime, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GetNetForUser", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("StartTime", SqlDbType.DateTime, 0, ParameterDirection.Input, StartTime),
                    new MSSQL.Parameter("EndTime", SqlDbType.DateTime, 0, ParameterDirection.Input, EndTime),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, DateTime StartTime, DateTime EndTime, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GetNetForUser", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("StartTime", SqlDbType.DateTime, 0, ParameterDirection.Input, StartTime),
                    new MSSQL.Parameter("EndTime", SqlDbType.DateTime, 0, ParameterDirection.Input, EndTime),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GoodSales
        {
            public static int Call(long UserID, long TypeID, int Amount, double Total, int PayType, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GoodSales", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("TypeID", SqlDbType.BigInt, 0, ParameterDirection.Input, TypeID),
                    new MSSQL.Parameter("Amount", SqlDbType.Int, 0, ParameterDirection.Input, Amount),
                    new MSSQL.Parameter("Total", SqlDbType.Money, 0, ParameterDirection.Input, Total),
                    new MSSQL.Parameter("PayType", SqlDbType.Int, 0, ParameterDirection.Input, PayType),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, long TypeID, int Amount, double Total, int PayType, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GoodSales", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("TypeID", SqlDbType.BigInt, 0, ParameterDirection.Input, TypeID),
                    new MSSQL.Parameter("Amount", SqlDbType.Int, 0, ParameterDirection.Input, Amount),
                    new MSSQL.Parameter("Total", SqlDbType.Money, 0, ParameterDirection.Input, Total),
                    new MSSQL.Parameter("PayType", SqlDbType.Int, 0, ParameterDirection.Input, PayType),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }

        public class P_GoodSales_Stat
        {
            public static int Call(string SaleStart, string SaleEnd, long UserIDs, string GoodNames)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_GoodSales_Stat", ref Outputs,
                    new MSSQL.Parameter("SaleStart", SqlDbType.VarChar, 0, ParameterDirection.Input, SaleStart),
                    new MSSQL.Parameter("SaleEnd", SqlDbType.VarChar, 0, ParameterDirection.Input, SaleEnd),
                    new MSSQL.Parameter("UserIDs", SqlDbType.BigInt, 0, ParameterDirection.Input, UserIDs),
                    new MSSQL.Parameter("GoodNames", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodNames)
                    );

                return CallResult;
            }

            public static DataSet Open(string SaleStart, string SaleEnd, long UserIDs, string GoodNames)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_GoodSales_Stat", ref Outputs,
                    new MSSQL.Parameter("SaleStart", SqlDbType.VarChar, 0, ParameterDirection.Input, SaleStart),
                    new MSSQL.Parameter("SaleEnd", SqlDbType.VarChar, 0, ParameterDirection.Input, SaleEnd),
                    new MSSQL.Parameter("UserIDs", SqlDbType.BigInt, 0, ParameterDirection.Input, UserIDs),
                    new MSSQL.Parameter("GoodNames", SqlDbType.VarChar, 0, ParameterDirection.Input, GoodNames)
                    );

                return ds;
            }
        }

        public class P_EarningToVirtual
        {
            public static int Call(long UserID, string ToUserName, double Money, string Remark, int Type, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                int CallResult = MSSQL.ExecuteStoredProcedureNonQuery("P_EarningToVirtual", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ToUserName", SqlDbType.VarChar, 0, ParameterDirection.Input, ToUserName),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("Remark", SqlDbType.VarChar, 0, ParameterDirection.Input, Remark),
                    new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return CallResult;
            }

            public static DataSet Open(long UserID, string ToUserName, double Money, string Remark, int Type, ref int ReturnValue, ref string ReturnDescription)
            {
                MSSQL.OutputParameter Outputs = new MSSQL.OutputParameter();

                DataSet ds = MSSQL.ExecuteStoredProcedureWithQuery("P_EarningToVirtual", ref Outputs,
                    new MSSQL.Parameter("UserID", SqlDbType.BigInt, 0, ParameterDirection.Input, UserID),
                    new MSSQL.Parameter("ToUserName", SqlDbType.VarChar, 0, ParameterDirection.Input, ToUserName),
                    new MSSQL.Parameter("Money", SqlDbType.Money, 0, ParameterDirection.Input, Money),
                    new MSSQL.Parameter("Remark", SqlDbType.VarChar, 0, ParameterDirection.Input, Remark),
                    new MSSQL.Parameter("Type", SqlDbType.Int, 0, ParameterDirection.Input, Type),
                    new MSSQL.Parameter("ReturnValue", SqlDbType.Int, 4, ParameterDirection.Output, ReturnValue),
                    new MSSQL.Parameter("ReturnDescription", SqlDbType.VarChar, 100, ParameterDirection.Output, ReturnDescription)
                    );

                try
                {
                    ReturnValue = System.Convert.ToInt32(Outputs["ReturnValue"]);
                }
                catch { }

                try
                {
                    ReturnDescription = System.Convert.ToString(Outputs["ReturnDescription"]);
                }
                catch { }

                return ds;
            }
        }
    }
}
